近来开始学习使用node.js和npm,以下是安装过程中遇到的小问题:
1、从node.js官网下好包并安装时一切顺利,在跟着教程使用npm测试npm install express出现了一大堆WARNINGS,后面看到一个博主说需要 “在命令行切换到安装nodejs文件下的nodejs\node_modules\npm 后执行npm install express” ,在命令行cd到npm后再次执行npm install express时WARN少了,但还是有这两条:
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
暂时先跳过这个警告,然后又跟着另外的教程走,先执行了npm install underscore 后再执行npm install express后居然两个包都安装好了…………十分的神奇..
C:\Users\Administrator>npm install express
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
+ [email protected]
updated 1 package in 16.213s
C:\Users\Administrator>d
'd' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
C:\Users\Administrator>d:
D:\>cd node.js
D:\node.js>cd node_modules
D:\node.js\node_modules>cd npm
D:\node.js\node_modules\npm>npm install express
npm notice created a lockfile as package-lock.json. You should commit this file.
+ [email protected]
added 47 packages in 7.992s
D:\node.js\node_modules\npm>npm install underscore
+ [email protected]
added 1 package in 4.262s
D:\node.js\node_modules\npm>npm install express
+ [email protected]
updated 1 package in 10.016s
目前不是很清楚这句话的意思:npm notice created a lockfile as package-lock.json. You should commit this file. 还需要多多上网查找,继续深入学习。