npm install不会创建node
我正在尝试为mongodb uni课程做作业。他们给了我们一些文件,说明是:
运行npm install mongodb
然后node app.js
由于某种原因,npm install不会创建node_modules目录,但我没有看到任何构建错误:
mongo-uni/hw1-2$ npm install mongodb
npm WARN package.json [email protected] path is also the name of a node core module.
npm http GET
npm http 304
npm http GET .2.5
npm http GET .0.3
npm http 304 .0.3
npm http 304 .2.5
> [email protected] install /home/jasonshark/node_modules/mongodb/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/jasonshark/node_modules/mongodb/node_modules/kerberos/build'
SOLINK_MODULE(target) Release/obj.target/kerberos.node
SOLINK_MODULE(target) Release/obj.target/kerberos.node: Finished
COPY Release/kerberos.node
make: Leaving directory `/home/jasonshark/node_modules/mongodb/node_modules/kerberos/build'
> [email protected] install /home/jasonshark/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/jasonshark/node_modules/mongodb/node_modules/bson/build'
CXX(target) Release/obj.target/bson/ext/bson.o
make: Leaving directory `/home/jasonshark/node_modules/mongodb/node_modules/bson/build'
[email protected] ../../../node_modules/mongodb
├── [email protected]
└── [email protected]
mongo-uni/hw1-2$ node app.js
Failed to load c++ bson extension, using pure JS version
'No document found'
回答如下:
npm init
这就是你所需要的。它会为您动态创建package.json文件。
npm install不会创建node
我正在尝试为mongodb uni课程做作业。他们给了我们一些文件,说明是:
运行npm install mongodb
然后node app.js
由于某种原因,npm install不会创建node_modules目录,但我没有看到任何构建错误:
mongo-uni/hw1-2$ npm install mongodb
npm WARN package.json [email protected] path is also the name of a node core module.
npm http GET
npm http 304
npm http GET .2.5
npm http GET .0.3
npm http 304 .0.3
npm http 304 .2.5
> [email protected] install /home/jasonshark/node_modules/mongodb/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/jasonshark/node_modules/mongodb/node_modules/kerberos/build'
SOLINK_MODULE(target) Release/obj.target/kerberos.node
SOLINK_MODULE(target) Release/obj.target/kerberos.node: Finished
COPY Release/kerberos.node
make: Leaving directory `/home/jasonshark/node_modules/mongodb/node_modules/kerberos/build'
> [email protected] install /home/jasonshark/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/jasonshark/node_modules/mongodb/node_modules/bson/build'
CXX(target) Release/obj.target/bson/ext/bson.o
make: Leaving directory `/home/jasonshark/node_modules/mongodb/node_modules/bson/build'
[email protected] ../../../node_modules/mongodb
├── [email protected]
└── [email protected]
mongo-uni/hw1-2$ node app.js
Failed to load c++ bson extension, using pure JS version
'No document found'
回答如下:
npm init
这就是你所需要的。它会为您动态创建package.json文件。