我使用 create-react-app 样板构建了一个小型反应应用程序。提供内容时npm run
一切正常。
但现在我第一次尝试运行构建器,因为我正处于想要展示演示的地步。我尝试运行npm run build
,但它出错了。这是 npm 日志:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm@3.3.12
3 info using node@v5.1.1
4 verbose config Skipping project config: /Users/falks/.npmrc. (matches userconfig)
5 verbose stack Error: ENOENT: no such file or directory, open '/Users/falks/package.json'
5 verbose stack at Error (native)
6 verbose cwd /Users/falks
7 error Darwin 15.6.0
8 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
9 error node v5.1.1
10 error npm v3.3.12
11 error path /Users/falks/package.json
12 error code ENOENT
13 error errno -2
14 error syscall open
15 error enoent ENOENT: no such file or directory, open '/Users/falks/package.json'
15 error enoent This is most likely not a problem with npm itself
15 error enoent and is related to npm not being able to find a file.
16 verbose exit [ -2, true ]
看来它正在我的开发文件夹之外寻找一个 package.json ?任何提示如何让构建器运行?
谢谢你。