zoukankan      html  css  js  c++  java
  • 一、创建一个新的react环境(npm ERR! Could not install from "Files odejs ode_cache\_npx13472" as it does not contain a package.json file.)

    1. 安装新版本的 node.js

    2. 执行 npx create-react-app my-app 创建一个 react 项目。

    3. cd my-app

    4. npm start

    问题:在创建 npm create-react-app my-app 时,报错:

    npm ERR! Could not install from "Files odejs ode_cache\_npx13472" as it does
    not contain a package.json file.

    原因:因为 node_cache 路径中有空格。

    执行:  npm config get cache

    结果为: D:Program Files odejs ode_cache

     路径中有空格。

    解决: npm config set cache "D:Program~1 odejs ode_modules pm ode_cache"--global

     即可。

  • 相关阅读:
    Hello World
    函数
    js基础
    html
    npm
    数据库
    前端了解的简要php
    模块
    scrapy爬虫
    php升级代码检查
  • 原文地址:https://www.cnblogs.com/lpp-11-15/p/14171696.html
Copyright © 2011-2022 走看看