microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.82k stars 592 forks source link

[Rush] Getting error when running command "rush update" #2151

Open gauravgoyal5 opened 4 years ago

gauravgoyal5 commented 4 years ago

Please prefix the issue title with the project name i.e. [rush], [api-extractor] etc.

Is this a feature or a 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.

GiriB commented 4 years ago

@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)?

gauravgoyal5 commented 4 years ago

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.

gauravgoyal5 commented 4 years ago

Hi,

I tried to run the Powershell ISE & got detailed error :

PS SPFx\Code\Production\MyTestProject> rush update

Rush Multi-Project Build Tool 5.33.2 - https://rushjs.io Node.js version is 10.18.1 (LTS)

Starting "rush update"

Ignoring Git validation because this is not a Git working folder.  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

Updating temp projects in SPFx\Code\Production\MyTestProject\common\temp\projects Finished creating temporary modules (0.06 seconds) Deleting the "npm-cache" folder Deleting the "npm-tmp" folder

Running "npm install" in SPFx\Code\Production\MyTestProject\common\temp

node.exe : The system cannot find the path specified. At C:\Users\gaura\AppData\Roaming\npm\rush.ps1:15 char:3

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 ERROR: The command failed with exit code 1 

PS SPFx\Code\Production\MyTestProject>

iclanton commented 4 years ago

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?

gauravgoyal5 commented 4 years ago

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.

dmichon-msft commented 3 years ago

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

gauravgoyal5 commented 3 years ago

Thanks for the reply. Can you please let me know in which file and path, I should add "\"?

gauravgoyal5 commented 3 years ago

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. image

tkvw commented 2 years ago

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", 
  },
jeanmaried commented 2 years ago

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.

gomain commented 2 years ago

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.