简体   繁体   English

无法在node.js中安装npm软件包

[英]unable to install npm packages in node.js

i am beginner for Node.js , i try to install some packages like express.js, underscore.js using Node.js by NPM but every time im trying to install using following command: 我是Node.js的初学者,我尝试通过NPM使用Node.js安装一些程序包,例如express.js,underscore.js,但每次尝试使用以下命令进行安装时:

npm install express , npm install express

npm install underscore

Its showing error. 其显示错误。 please Refer following image,. 请参考下图。 please help me to fix this. 请帮助我解决此问题。 how to install packages in npm by node.js 如何通过node.js在npm中安装软件包

在此处输入图片说明

Thanks in Advance... 提前致谢...

You type npm view insted of npm install . 您键入npm install npm view Also you can add --save option 您也可以添加--save选项

npm install underscore --save

What is the --save option for npm install? npm install的--save选项是什么?

as some other say, u looks having problem with network.. i've never try "npm view express" but in my case it give a list of all the repository and file .. are u sure u have installed node? 就像其他人说的那样,您似乎遇到了网络问题。我从未尝试过“ npm view express”,但就我而言,它给出了所有存储库和文件的列表..您确定已安装节点吗?

node -v 节点-v

if u have something like v6.9.4 (this is my current version.. yours can be more recent) 如果您有v6.9.4之类的东西(这是我当前的版本。您的版本可能是最新的)

try to create "package.json" using: npm init -y 尝试使用以下命令创建“ package.json”:npm init -y

and then: npm i --save express 然后:npm i-保存快递

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

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