微信小程序新手:app.json中写的pages没有自动生成,下面是报错信息,请各位大佬指点。
我按照网上说使用npm run dev报错:
npm ERR! code ENOENT
npm ERR! syscall opennpm ERR! path E:\WeChatProjects\miniprogram-1\miniprogram\package.jsonnpm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'E:\WeChatProjects\miniprogram-1\miniprogram\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoentnpm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-10-21T15_31_29_387Z-debug.log
log日志
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'D:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev'
1 verbose cli ]
2 info using npm@6.11.3
3 info using node@v12.12.0
4 verbose stack Error: ENOENT: no such file or directory, open 'E:\WeChatProjects\miniprogram-1\miniprogram\package.json'
5 verbose cwd E:\WeChatProjects\miniprogram-1\miniprogram
6 verbose Windows_NT 10.0.17763
7 verbose argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
8 verbose node v12.12.0
9 verbose npm v6.11.3
10 error code ENOENT
11 error syscall open
12 error path E:\WeChatProjects\miniprogram-1\miniprogram\package.json
13 error errno -4058
14 error enoent ENOENT: no such file or directory, open 'E:\WeChatProjects\miniprogram-1\miniprogram\package.json'
15 error enoent This is related to npm not being able to find a file.
16 verbose exit [ -4058, true ]
这是项目目录结构和app.json.
这是什么问题win7电脑安装npm
app.json中新建的pages不要放在第一位
我也遇到这样的情况,调换一下页面的顺序,然后多保存几次就好了
一般是反过来才对吧,新建文件,app.json里会自动生成
我的做法是先在目录树那里建目录和page,然后app.json会给我自动生成新建的路径