miniprogram-demo
miniprogram-demo copied to clipboard
npm run init 就报错
第一次报错是找不到 tnpm。改成 npm 后其他报错如下。
`PS D:\WeChat\miniprogram-demo> npm run init
[email protected] init cd cloudfunctions/ && tnpm i --production && cd ../miniprogram/ && tnpm i --production
'tnpm' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 PS D:\WeChat\miniprogram-demo> npm run init
[email protected] init cd cloudfunctions/ && npm i --production && cd ../miniprogram/ && npm i --production
npm WARN config production Use --omit=dev
instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR! dev eslint@"^7.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^4.19.1 || ^5.3.0" from [email protected]
npm ERR! node_modules/eslint-config-airbnb-base
npm ERR! dev eslint-config-airbnb-base@"13.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\chao\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\chao\AppData\Local\npm-cache_logs\2022-08-22T03_20_33_300Z-debug-0.log`
后面添加 --legacy-peer-deps, 再安装试试看
报错:貌似是没有把 eslint-config-wxapp 推送到 registry.npmjs.org? 另外,我在 https://npm.io/ 看到的这个 版本号是 1.0.0,这里用的是0.5.2?
`PS D:\WeChat\miniprogram-demo> npm run init --legacy-peer-deps
[email protected] init cd cloudfunctions/ && npm i --production && cd ../miniprogram/ && npm i --production
npm WARN config production Use --omit=dev
instead.
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@tencent%2feslint-config-wxapp - Not found
npm ERR! 404
npm ERR! 404 '@tencent/eslint-config-wxapp@^0.5.2' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\chao\AppData\Local\npm-cache_logs\2022-08-22T07_25_48_206Z-debug-0.log`
真是个沙雕文档,啥都写不清楚,一运行各种报错
在文件根目录下运行npm run init --legacy-peer-deps
在文件根目录下运行npm run init --legacy-peer-deps
这行命令可以解决报错。
我当时的报错是
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR! dev eslint@"^7.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^4.19.1 || ^5.3.0" from [email protected]
npm ERR! node_modules/eslint-config-airbnb-base
npm ERR! dev eslint-config-airbnb-base@"13.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/y/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/y/.npm/_logs/2022-09-28T12_06_07_063Z-debug-0.lo
沙雕文档+1
沙雕文档+1