【问题标题】:npm ERR! code ERR_OSSL_PEM_NO_START_LINE and routines:get_name:no start line when installing ReactJSnpm 错误!安装 ReactJS 时代码 ERR_OSSL_PEM_NO_START_LINE 和例程:get_name:no start line
【发布时间】:2022-02-23 23:43:26
【问题描述】:

我试图安装 react,但它一直说正在中止安装我正在使用节点 v16-14-0 npm v6-14-11。

npx creat-react-app my-app
npx: installed 67 in 13.6s

creating a new react app in C:\User\adminstrator\my-app.
npm ERR! code ERR_OSSL_PEM_NO_START_LINE
npm ERR! error:0909006c:PEM routines:get_name:no start line

npm ERR! A complete log of this run can be found in:
npm ERR! C:User\adminstrator\my-app\_logs\2021-03-18T12_17_27_469Z-debug.log

Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-script cra-template has failed.
Deleting generated file... package.json

【问题讨论】:

标签: node.js reactjs npm create-react-app


【解决方案1】:

我之前也遇到过这种错误,卸载和删除所有节点相关文件解决了这个问题。

1 - 使用卸载程序从程序和功能中卸载 nodejs。

2 - 删除这些文件:

C:\Program Files (x86)\Nodejs

C:\Program Files\Nodejs

C:\Users\{User}\AppData\Roaming\npm

C:\Users\{User}\AppData\Roaming\npm-cache

C:\Users\{User}\.npmrc (and possibly check for that without the . prefix too)

3 - 或者你可以这样做

npm clear cache

然后,再次检查这些文件是否未被删除,并且 删除这些文件

C:\User\user\appdata\roaming\npm-cache

C:\User\user\appdata\roaming\npm

C:\User\user\appdata\Local\Temp

C:\programefile\nodejs

4 - 转到这个 C:\User{user} 如果它被隐藏然后取消隐藏它并删除 .npmrc 文件并删除所有相关文件(大约 4 或 5 个文件)

5 - 如果卸载成功(您可以检查 node --version)然后重新启动您的计算机

6 - 然后,输入此命令

npm set registry http://registry.npmjs.org/ 

7 - 终于可以开始了

npx create-react-app app_name 
   or 
npm install <package-name>

【讨论】:

    【解决方案2】:

    尝试从 C:\Users{username} 中删除 .npmrc。这对我有用。

    【讨论】:

    • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 2021-04-01
    • 2018-07-22
    • 2020-10-30
    • 1970-01-01
    • 2019-08-20
    • 2022-11-20
    • 2021-02-25
    • 2016-05-03
    相关资源
    最近更新 更多