[Rush] Getting error when running command "rush update"
Please prefix the issue title with the project name i.e. [rush], [api-extractor] etc.
Is this a feature or a bug?
- [ ] Feature
- [X] Bug
Actual behavior.
When I am running rush update, it is showing error : The system cannot find the path specified. `The command failed: D:\SPFx\Code\Production\MyTestProject\common\temp\npm-local\node_modules.bin\npm install --cache D:\SPFx\Code\Production\MyTestProject\common\temp\npm-cache --tmp D:\SPFx\Code\Production\MyTestProject\common\temp\npm-tmp ERROR: Error: The command failed with exit code 1
Trying again (attempt #2)...
The system cannot find the path specified.
The command failed: D:\SPFx\Code\Production\MyTestProject\common\temp\npm-local\node_modules.bin\npm install --cache D:\SPFx\Code\Production\MyTestProject\common\temp\npm-cache --tmp D:\SPFx\Code\Production\MyTestProject\common\temp\npm-tmp ERROR: Error: The command failed with exit code 1
Trying again (attempt #3)...
The system cannot find the path specified.
The command failed: D:\SPFx\Code\Production\MyTestProject\common\temp\npm-local\node_modules.bin\npm install --cache D:\SPFx\Code\Production\MyTestProject\common\temp\npm-cache --tmp D:\SPFx\Code\Production\MyTestProject\common\temp\npm-tmp ERROR: Error: The command failed with exit code 1
Giving up after 3 attempts
ERROR: The command failed with exit code 1`
What is the expected behavior? It should run rush update command & then after rush build
If this is a bug, please provide the tool version, Node.js version, and OS.
- Tool: NPM, Windows 10, @microsoft/generator-sharepoint, VS Code, rush
- Tool Version: NPM : 6.13.4, @microsoft/generator-sharepoint:1.11.0, rush : 5.23.4
-
Node Version: 10.18.1
- Is this a LTS version?Yes
- Have you tested on a LTS version?Yes
- OS:Windows 10
@gauravgoyal5 Can you create a repro and share the code? Also, is this something that suddenly started to fail for you (Was it working before)?
Correct. It started suddenly. It was working before. I am trying to create new project in SPFx & got the same issues. I tried so many times with different locations as well but getting same issue.
Hi,
I tried to run the Powershell ISE & got detailed error :
PS SPFx\Code\Production\MyTestProject> rush update
[1mRush Multi-Project Build Tool 5.33.2[22m[36m - https://rushjs.io[39m Node.js version is 10.18.1 (LTS)
Starting "rush update"
[36mIgnoring Git validation because this is not a Git working folder.[39m [36m[39m Validating package manager shrinkwrap file.
Shrinkwrap file could not be found, skipping validation.
Trying to acquire lock for npm-6.13.4 Acquired lock for npm-6.13.4 Found npm version 6.13.4 in C:\Users\gaura.rush\node-v10.18.1\npm-6.13.4
Symlinking "SPFx\Code\Production\MyTestProject\common\temp\npm-local" --> "C:\Users\gaura.rush\node-v10.18.1\npm-6.13.4" Copying SPFx\Code\Production\MyTestProject\common\config\rush.npmrc --> SPFx\Code\Production\MyTestProject\common\temp.npmrc
[1mUpdating temp projects in SPFx\Code\Production\MyTestProject\common\temp\projects[22m Finished creating temporary modules (0.06 seconds) Deleting the "npm-cache" folder Deleting the "npm-tmp" folder
[1mRunning "npm install" in SPFx\Code\Production\MyTestProject\common\temp[22m
node.exe : The system cannot find the path specified. At C:\Users\gaura\AppData\Roaming\npm\rush.ps1:15 char:3
- & "node$exe" "$basedir/node_modules/@microsoft/rush/bin/rush" $arg ...
-
+ CategoryInfo : NotSpecified: (The system cann...path specified.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError
The command failed: SPFx\Code\Production\MyTestProject\common\temp\npm-local\node_modules.bin\npm install --cache SPFx\Code\Production\MyTestProject\common\temp\npm-cache --tmp SPFx\Code\Production\MyTestProject\common\temp\npm-tmp ERROR: Error: The command failed with exit code 1
Trying again (attempt #2)...
The system cannot find the path specified.
The command failed: SPFx\Code\Production\MyTestProject\common\temp\npm-local\node_modules.bin\npm install --cache SPFx\Code\Production\MyTestProject\common\temp\npm-cache --tmp SPFx\Code\Production\MyTestProject\common\temp\npm-tmp ERROR: Error: The command failed with exit code 1
Trying again (attempt #3)...
The system cannot find the path specified.
The command failed: SPFx\Code\Production\MyTestProject\common\temp\npm-local\node_modules.bin\npm install --cache SPFx\Code\Production\MyTestProject\common\temp\npm-cache --tmp SPFx\Code\Production\MyTestProject\common\temp\npm-tmp ERROR: Error: The command failed with exit code 1
Giving up after 3 attempts [31mERROR: The command failed with exit code 1[39m [31m[39m
PS SPFx\Code\Production\MyTestProject>
D:\SPFx\Code\Production\MyTestProject\common\temp\npm-local is a symlink to a folder under your HOME directory. Can you take a look at that folder and make sure it points to something valid?
Did you recently move your HOME directory?
npm-local folder is present as symlink under D:\SPFx\Code\Production\MyTestProject\common\temp. No I have not moved. I am getting same issue when creating new structure in new place as well.
I notice the listed paths seem to be missing a \ between node_modules and .bin; this suggest that there is a missing trailing slash in a configured path for npm-local
Thanks for the reply. Can you please let me know in which file and path, I should add ""?
I tried to search for path which shown in log : The command failed: D:\SPFx\Code\Production\MyTestProject\common\temp\npm-local**node_modules.bin**npm install --cache D:\SPFx\Code\Production\MyTestProject\common\temp\npm-cache --tmp D:\SPFx\Code\Production\MyTestProject\common\temp\npm-tmp ERROR: Error: The command failed with exit code 1
I found that, in npm-local folder there is no node_module folder present.

I has a similar issue, for me it was an invalid package.json file.
"devDependencies": {
"tslib": "^2.3.1"
},
vs
"devDependencies": {
"tslib": "^2.3.1",
},
What resolved it for me was to delete the .rush folder in C:\Users\MyUser and reinstall rush. Not sure I even needed to reinstall rush to be honest. I noticed the .rush folder popped back up after running rush update.
This also happened to me and indeed it was a trailing comma in one of a package.json file in the "keywords" section.
The error message in very misleading though. I was getting
The command failed:
/path/to/pnpm install --store /path/to/repo/common/temp/pnpm-store --no-prefer-frozen-lockfile --recursive --link-workspace-packages false
ERROR: Error: The command failed with exit code 1
Trying again (attempt #2)...
Deleting the "node_modules" folder
The command failed:
/path/to/pnpm install --store /path/to/repo/common/temp/pnpm-store --no-prefer-frozen-lockfile --recursive --link-workspace-packages false
ERROR: Error: The command failed with exit code 1
Trying again (attempt #3)...
Deleting the "node_modules" folder
The command failed:
/path/to/pnpm install --store /path/to/repo/common/temp/pnpm-store --no-prefer-frozen-lockfile --recursive --link-workspace-packages false
ERROR: Error: The command failed with exit code 1
Giving up after 3 attempts
Rush does complain about syntax error in rush.json so would have expected the same for other json files. Well this is pnpm failing without complaining about malformed json.
For what it's worth, after updating from "rushVersion": "5.76.1" to "rushVersion": "5.153.2", in my rush.json, the very unhelpful error message ERROR: The command failed with exit code 1 changed to the very helpful:
ERROR: Expected double-quoted property name in JSON at position 469 (line 14 column 9)
Filename: /path/to/my/repo/sub-module/package.json
Seems like recent versions, rush.js now passes the error message from the failed call instead of just the exit code.