search

Home  >  Q&A  >  body text

javascript - After node is installed, npm always reports that it is not an internal command. How to solve it?

Overview

Question 1: The following error keeps reporting!

Problem 2: npm can install dependent packages, but it cannot run. For example, npm run dev, the following error will be reported

给我你的怀抱给我你的怀抱2737 days ago684

reply all(7)I'll reply

  • PHP中文网

    PHP中文网2017-05-24 11:40:40

    It should be that the environment variables are not set properly.
    You can refer to here:/a/11...

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-24 11:40:40

    npm run dev must be run in the directory with package.json

    reply
    0
  • 怪我咯

    怪我咯2017-05-24 11:40:40

    The directory is not entered, right?

    reply
    0
  • ringa_lee

    ringa_lee2017-05-24 11:40:40

    添加系统环境变量,选择安装的node目录

    用户环境变量,也就是其他npm包的位置

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-24 11:40:40

    I guess it’s because the command line tool you have is not working properly. Don’t use the one that comes with node. Try using cmd

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-24 11:40:40

    Create a new user variable NODE_PATH in Advanced System Settings-Environment Variables
    Value C:Program Filesnodejsnode_modules

    reply
    0
  • ringa_lee

    ringa_lee2017-05-24 11:40:40

    Does your node have environment variables?

    reply
    0
  • Cancelreply