Hello,
I am getting the following message when trying to run npm install -g netlify-cli.
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
added 1359 packages in 47s
180 packages are looking for funding
run `npm fund` for details
When I type netlify command it gives me netlify: command not found
error
Please help.
Is the path where netlify
(and other globally installed node packages) in the $PATH
variable in the shell?
Try
% whereis netlify
netlify: /usr/local/bin/netlify
(this is an example.)
Then check $PATH
(based on the above example path)
% echo $PATH | grep --color=always '/usr/local/bin'
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
(your results will vary to the above.)
When I tried type
whereis netlify
I am getting the following response:
netlify:
Whatβs that suppose to mean?
That the system cannot find it. Quite possibly because it doesnβt exist (isnβt installed) or possibly because the location isnβt indexed.
I have installed as a test.
% npm install -g netlify-cli
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
added 1359 packages in 26s
180 packages are looking for funding
run `npm fund` for details
Then run
% whereis netlify
netlify: /usr/local/bin/netlify
You can check which npm packages are globally installed using
% npm list -g
usr/local/lib
βββ @gridsome/cli@0.3.4
βββ chalk@4.1.2
βββ corepack@0.17.0
βββ http-server@14.1.1
βββ lambda-local@2.0.0
βββ netlify-cli@15.0.0
βββ npm-run-all@4.1.5
βββ npm@9.5.1
βββ serve@14.2.0
βββ yarn@1.22.19
(the above is an example.)
Hello @jasiqli I donβt get what do you mean by that.
Here is the output when I run npm list -g
/usr/local/Cellar/node/20.1.0/lib
βββ netlify-cli@15.0.0
βββ npm@9.6.6
That shows that netlify-cli
is installed. However, the location is different because you used Brew to install node
instead of the office pacakge from the node website.
If you have only just installed node
you may need to restart the terminal for the $PATH
to update.
I cannot remember if brew automatically appends the /path/to/node
and the Node modules directory to $PATH
(havenβt used it in some time) or whether you need to append it manually (think the former, butβ¦)
I got it fixed now.
It appears that I need to run brew unlink node
and brew link node
to perform symlink in my system.
Cheers
1 Like