Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run init 就报错 #60

Open
ttkrpink opened this issue Aug 22, 2022 · 7 comments
Open

npm run init 就报错 #60

ttkrpink opened this issue Aug 22, 2022 · 7 comments

Comments

@ttkrpink
Copy link

第一次报错是找不到 tnpm。改成 npm 后其他报错如下。

`PS D:\WeChat\miniprogram-demo> npm run init

miniprogram-demo@1.0.0 init
cd cloudfunctions/ && tnpm i --production && cd ../miniprogram/ && tnpm i --production

'tnpm' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
PS D:\WeChat\miniprogram-demo> npm run init

miniprogram-demo@1.0.0 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: miniprogram-demo@1.0.0
npm ERR! Found: eslint@7.32.0
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 eslint-config-airbnb-base@13.1.0
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`

@VirtualStarry
Copy link
Collaborator

后面添加 --legacy-peer-deps, 再安装试试看

@ttkrpink
Copy link
Author

ttkrpink commented Aug 22, 2022

报错:貌似是没有把 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

miniprogram-demo@1.0.0 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`

@yun36524
Copy link

真是个沙雕文档,啥都写不清楚,一运行各种报错

@VirtualStarry
Copy link
Collaborator

在文件根目录下运行npm run init --legacy-peer-deps

@yzsatgithub
Copy link

在文件根目录下运行npm run init --legacy-peer-deps

这行命令可以解决报错。

我当时的报错是

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: miniprogram-demo@1.0.0
npm ERR! Found: eslint@7.32.0
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 eslint-config-airbnb-base@13.1.0
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

@formagic
Copy link

formagic commented Apr 4, 2023

沙雕文档+1

1 similar comment
@ParticleDog
Copy link

沙雕文档+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants