简体   繁体   English

npm 命令不起作用

[英]npm commands are not working

I have installed Node.js and at first when I wrote an npm command like npm install -g <> or npm start it worked, but now it doesn't.我已经安装了 Node.js,起初当我写了一个像npm install -g <>npm start这样的 npm 命令npm start它起作用了,但现在没有了。 I removed and installed node again and am still facing the same problem:我再次删除并安装了节点,但仍然面临同样的问题:

~$ npm install
~$

No action is made and the terminal returns back to normal.没有任何动作,终端恢复正常。

npm install looks for a package.json file in your current directory. npm install在当前目录中查找package.json文件。 It installs all the dependencies listed in the package.json .它安装package.json列出的所有依赖项。 Similarly npm start looks in the package.json scripts to see what command it should really run.同样, npm startpackage.json脚本中查看它应该真正运行什么命令。 If it doesn't work now, you are probably in the wrong directory.如果它现在不起作用,您可能在错误的目录中。 If you are in the correct directory, can you provide more information like the exact error message you are getting?如果您在正确的目录中,能否提供更多信息,例如您收到的确切错误消息?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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