alsotang / node-lessons

:closed_book:《Node.js 包教不包会》 by alsotang
16.54k stars 4.7k forks source link

npm WARN enoent ENOENT #105

Open banditsmile opened 8 years ago

banditsmile commented 8 years ago

npm@3.10.5 node@4.1.1 在执行npm install express的时候提示npm WARN enoent ENOENT... 命令执行完以后当前目录下面没有node_modules目录,express安装失败

在网上搜索之后发现需要执行npm init

aimer1124 commented 8 years ago

@banditsmile 应该是版本的问题,我自己电脑上面没有问题

➜  All node -v&&npm -v
v4.4.3
2.15.1
➜  All mkdir test&&cd test
➜  test npm install express
express@4.14.0 ../../../node_modules/express
├── content-type@1.0.2
├── vary@1.1.0
├── encodeurl@1.0.1
├── serve-static@1.11.1
├── cookie@0.3.1
├── range-parser@1.2.0
├── qs@6.2.0
├── finalhandler@0.5.0 (statuses@1.3.0)
├── proxy-addr@1.1.2 (ipaddr.js@1.1.1)
├── send@0.14.1 (statuses@1.3.0, http-errors@1.5.0)
├── type-is@1.6.13 (mime-types@2.1.11)
└── accepts@1.3.3 (negotiator@0.6.1, mime-types@2.1.11)
billni commented 8 years ago

我也是同样问题,npm init后就好了。