简体   繁体   中英

'clinic' is not recognized as an internal or external command, operable program or batch file

I tried following the documentation for Clinic.js https://clinicjs.org/documentation/

First i installed clinic globally as instructed npm install -g clinic

When installing this appeared

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
C:\Users\ASUS\AppData\Roaming\npm\clinic -> C:\Users\ASUS\AppData\Roaming\npm\node_modules\clinic\bin.js
+ clinic@9.0.0
updated 3 packages in 210.329s

After that when I try running the command clinic --help I get the error 'clinic' is not recognized as an internal or external command, operable program or batch file.

my node version is v14.15.1 .
Any idea how to fix this?

The problem was I didn't have my global packages directory added to my PATH. This answered my issue.

First I ran the command npm get prefix to get the global packages directory path. The path appeared to be C:\\Users\\ASUS\\AppData\\Roaming\\npm .

Then I went to Edit the sysem environment variables using the Windows search. Clicked on Environment Variables... on bottom right. Double clicked Path from User variables section. Added C:\\Users\\ASUS\\AppData\\Roaming\\npm as a new path and clicked Ok.

Restarted my IDE and ran clinic --help and got the response Clinic - v9.0.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM