4
votes

i am getting error, The system cannot find the path specified. when adding test new project into node.js command prompt getting error. I am totally confused to create new project.

Your environment has been set up for using Node.js 12.14.1 (x64) and npm.

C:\Users\user>npm install -g @angular/cli
C:\Users\user\AppData\Roaming\npm\ng -> C:\Users\user\AppData\Roaming\npm\node_m
odules\@angular\cli\bin\ng

> @angular/[email protected] postinstall C:\Users\user\AppData\Roaming\npm\node_modules
\@angular\cli
> node ./bin/postinstall/script.js

+ @angular/[email protected]
updated 1 package in 59.885s

C:\Users\user>ng new test
The system cannot find the path specified.

I am using operating system window 8.1 pro version In my system below variables added

1) User variables for user

NODE_PATH: C:\Users\user\AppData\Roaming\npm\node_modules

Path:C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;%USERPROFILE%.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;%AppData%\npm;;C:\Program Files (x86)\Microsoft VS Code\bin;%AppData%\npm;C:\Program Files\nodejs\;C:\Users\user\AppData\Roaming\npm

2) System variables

Path:%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;%USERPROFILE%.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;%AppData%\npm

4
Are you on a Windows machine or a Mac? - tomerpacific
i am on windows. @tomerpacific - mohd mazhar khan
I'm assuming you've closed the console that you installed from at some point and opened a new one and it's still not working? (sometimes the console needs to be restarted for new path variables to be available to it, although I've not had that problem installing angular). - JDunken
Add environment variables and check - Akhil Aravind
@mohdmazharkhan can you check this question: stackoverflow.com/questions/39190164/… - Hope

4 Answers

0
votes

Try to run the following commands:

  1. npm install -g npm@latest
  2. npm config set script-shell bash

After that, run the ng new command again.

0
votes

Just want to rule out the possibility of Path corruption. Please try the following:

rem for future
setx NODE_PATH %AppData%\npm\node_modules
rem for current session
set NODE_PATH=%AppData%\npm\node_modules
setx path "%path%;%AppData%\npm"
ng -v

Modified version to the original answer: https://stackoverflow.com/a/9588052/639107

0
votes

Not sure if you are actually creating a project called test.

At least until 8.0 it was impossible to create a project with the name test. You'd get some warning about an invalid project name. Try to create another project with another name. cli-test for example.

0
votes

If nothing works then have a fresh setup. unintsall node and all then install everything you need. make sure abouth PATH