老师,koa使用脚手架,全局安装了,但是定位到项目问价夹,怎么安装不上呢

老师,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

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕小李 2022-06-08 11:04:37

同学你好,请尝试npm run dev运行一下试试,通过同学提供的信息来看,应该是已经安装成功了。

祝学习愉快!

  • 提问者 FalseMask #1

    老师是显示安装上了,但是我的项目文件夹没有搭建环境,文件也刷新了

    https://img1.sycdn.imooc.com//climg/62a025ce0934d68608020744.jpg

    2022-06-08 12:30:24
  • 好帮手慕小李 回复 提问者 FalseMask #2

    同学你好,从截图与上面代码中的信息来看,同学应该是把项目安装到了nodejs-koa的项目中了,截图中打开的是nodejs-koa2项目。

    https://img1.sycdn.imooc.com//climg/62a034a009284d4205870061.jpg

    那么同学这里查看一下是否有nodejs-koa项目,如果有那么打开看看是否已经安装成功并且已经搭建成功。

    祝学习愉快!

    2022-06-08 13:33:34
  • 提问者 FalseMask 回复 好帮手慕小李 #3

    老师,没搭建起来,是同一个文件夹

    https://img1.sycdn.imooc.com//climg/62a06b93091d637908380746.jpg

    2022-06-08 17:28:27
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师