搞不懂了,尝试好久,不知道是什么问题

搞不懂了,尝试好久,不知道是什么问题

Last login: Sat Feb  8 15:05:32 on ttys000

linchundeMacBook-Air:~ linchun$ vue -h

Usage: vue <command> [options]


Options:

  -V, --version  output the version number

  -h, --help     output usage information


Commands:

  init           generate a new project from a template

  list           list available official templates

  build          prototype a new project

  create         (for v3 warning only)

  help [cmd]     display help for [cmd]

linchundeMacBook-Air:~ linchun$ vue list


  Available official templates:


  ★  browserify - A full-featured Browserify + vueify setup with hot-reload, linting & unit testing.

  ★  browserify-simple - A simple Browserify + vueify setup for quick prototyping.

  ★  pwa - PWA template for vue-cli based on the webpack template

  ★  simple - The simplest possible Vue setup in a single HTML file

  ★  webpack - A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.

  ★  webpack-simple - A simple Webpack + vue-loader setup for quick prototyping.


linchundeMacBook-Air:~ linchun$ vue init webpack mall-project


? Target directory exists. Continue? Yes

? Project name mall-project

? Project description 在线商城WebApp

? Author 

? Vue build runtime

? Install vue-router? Yes

? Use ESLint to lint your code? Yes

? Pick an ESLint preset Standard

? Set up unit tests No

? Setup e2e tests with Nightwatch? No

? Should we run `npm install` for you after the project has been created? (recom

mended) no


   vue-cli · Generated "mall-project".


# Project initialization finished!

# ========================


To get started:


  cd mall-project

  npm install (or if using yarn: yarn)

  npm run lint -- --fix (or for yarn: yarn run lint --fix)

  npm run dev

  

Documentation can be found at https://vuejs-templates.github.io/webpack



linchundeMacBook-Air:~ linchun$ cd /Users/linchun/Desktop/vue-mall cd mall-project

linchundeMacBook-Air:vue-mall linchun$ cnpm install

npminstall WARN package.json not exists: /Users/linchun/Desktop/vue-mall/package.json

✔ Installed 0 packages

✔ Linked 0 latest versions

✔ Run 0 scripts

✔ All packages installed (used 8ms(network 5ms), speed 0B/s, json 0(0B), tarball 0B)

linchundeMacBook-Air:vue-mall linchun$ npm run lint -- --fix

npm ERR! code ENOENT

npm ERR! syscall open

npm ERR! path /Users/linchun/Desktop/vue-mall/package.json

npm ERR! errno -2

npm ERR! enoent ENOENT: no such file or directory, open '/Users/linchun/Desktop/vue-mall/package.json'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent 


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/linchun/.npm/_logs/2020-02-08T07_16_38_559Z-debug.log

linchundeMacBook-Air:vue-mall linchun$ 

http://img1.sycdn.imooc.com//climg/5e3e60aa08a5c15505770294.jpg


正在回答 回答被采纳积分+1

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

4回答
提问者 Sunflower加油 2020-02-09 15:50:30

http://img1.sycdn.imooc.com//climg/5e3fb981084553c703480172.jpg按照老师视频的操作步骤,操作了很多次最后就只有一个这个空文件。不知道什么原因项目创建不出

Last login: Sun Feb  9 15:41:31 on ttys000

linchundeMacBook-Air:~ linchun$ vue init webpack mall-project


? Target directory exists. Continue? Yes

? Project name mall-project

? Project description A Vue.js project

? Author 

? Vue build runtime

? Install vue-router? Yes

? Use ESLint to lint your code? Yes

? Pick an ESLint preset Standard

? Set up unit tests No

? Setup e2e tests with Nightwatch? No

? Should we run `npm install` for you after the project has been created? (recom

mended) no


   vue-cli · Generated "mall-project".


# Project initialization finished!

# ========================


To get started:


  cd mall-project

  npm install (or if using yarn: yarn)

  npm run lint -- --fix (or for yarn: yarn run lint --fix)

  npm run dev

  

Documentation can be found at https://vuejs-templates.github.io/webpack



linchundeMacBook-Air:~ linchun$ cd /Users/linchun/Desktop/vue-mall cd mall-project

linchundeMacBook-Air:vue-mall linchun$ npm cache clean --force

npm WARN using --force I sure hope you know what you are doing.

linchundeMacBook-Air:vue-mall linchun$ cnpm install

npminstall WARN package.json not exists: /Users/linchun/Desktop/vue-mall/package.json

✔ Installed 0 packages

✔ Linked 0 latest versions

✔ Run 0 scripts

✔ All packages installed (used 7ms(network 4ms), speed 0B/s, json 0(0B), tarball 0B)

linchundeMacBook-Air:vue-mall linchun$ npm run lint -- --fix

npm ERR! code ENOENT

npm ERR! syscall open

npm ERR! path /Users/linchun/Desktop/vue-mall/package.json

npm ERR! errno -2

npm ERR! enoent ENOENT: no such file or directory, open '/Users/linchun/Desktop/vue-mall/package.json'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent 


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/linchun/.npm/_logs/2020-02-09T07_48_01_196Z-debug.log

linchundeMacBook-Air:vue-mall linchun$ npm run dev

npm ERR! code ENOENT

npm ERR! syscall open

npm ERR! path /Users/linchun/Desktop/vue-mall/package.json

npm ERR! errno -2

npm ERR! enoent ENOENT: no such file or directory, open '/Users/linchun/Desktop/vue-mall/package.json'

npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! enoent 


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/linchun/.npm/_logs/2020-02-09T07_48_21_118Z-debug.log

linchundeMacBook-Air:vue-mall linchun$ 



好帮手慕言 2020-02-09 10:08:27

同学你好,如果文件里面没有的话,建议:可以按照老师的步骤重新创建一个试试。如果我的回答帮助到了你,欢迎采纳,祝学习愉快~

好帮手慕星星 2020-02-08 19:22:55

同学你好,这个文件项目中是存在的哦,可以打开自己的文件目录看一下,例如源码

http://img1.sycdn.imooc.com//climg/5e3e99cc09fcf69007350362.jpg

终端进入mall文件夹,下面有package文件就好。

如果还不确定,可以将自己的项目文件夹打开,截图粘贴上来,老师看一下,便于帮助解决。

祝学习愉快!

  • 提问者 Sunflower加油 #1
    不知道什么原因我的文件夹生成不出
    2020-02-08 20:12:52
  • 提问者 Sunflower加油 #2
    我都是按照老师的步骤来操作的
    2020-02-08 20:13:23
好帮手慕星星 2020-02-08 17:34:06

同学你好,报错是找不到package.json文件。终端目录是在有package.json文件下吗?例如:

http://img1.sycdn.imooc.com//climg/5e3e805709e8d59702600379.jpg

终端进入的目录是项目文件夹,这样才可以找到文件,建议检查一下哦。

祝学习愉快!

  • 提问者 Sunflower加油 #1
    这个文件怎么才有呢
    2020-02-08 18:24:26
问题已解决,确定采纳
还有疑问,暂不采纳

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

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

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

在线咨询

领取优惠

免费试听

领取大纲

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