老师,koa使用脚手架,全局安装了,但是定位到项目问价夹,怎么安装不上呢
➜ ~ sudo npm install -g koa-generator
Password:
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
/usr/local/bin/koa -> /usr/local/lib/node_modules/koa-generator/bin/koa
/usr/local/bin/koa2 -> /usr/local/lib/node_modules/koa-generator/bin/koa2
+ koa-generator@1.1.17
updated 1 package in 0.601s
➜ ~ koa --version
1.1.17
➜ ~ koa2 nodejs-koa
create : nodejs-koa
create : nodejs-koa/package.json
create : nodejs-koa/app.js
create : nodejs-koa/public
create : nodejs-koa/public/images
create : nodejs-koa/routes
create : nodejs-koa/routes/index.js
create : nodejs-koa/routes/users.js
create : nodejs-koa/views
create : nodejs-koa/views/index.pug
create : nodejs-koa/views/layout.pug
create : nodejs-koa/views/error.pug
create : nodejs-koa/public/javascripts
create : nodejs-koa/public/stylesheets
create : nodejs-koa/public/stylesheets/style.css
create : nodejs-koa/bin
create : nodejs-koa/bin/www
install dependencies:
$ cd nodejs-koa && npm install
run the app:
$ DEBUG=nodejs-koa:* npm start
➜ ~ cd nodejs-koa
➜ nodejs-koa npm install
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
> fsevents@1.2.13 install /Users/huangfuguobei/nodejs-koa/node_modules/fsevents
> node install.js
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
> core-js@2.6.12 postinstall /Users/huangfuguobei/nodejs-koa/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> nodemon@1.19.4 postinstall /Users/huangfuguobei/nodejs-koa/node_modules/nodemon
> node bin/postinstall || exit 0
Love nodemon? You can now support the project via the open collective:
> https://opencollective.com/nodemon/donate
npm notice created a lockfile as package-lock.json. You should commit this file.
added 397 packages from 271 contributors in 32.706s
14 packages are looking for funding
run `npm fund` for details
➜ nodejs-koa
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星