Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Script with directory iteration does not parse correctly as of 8.13.0 #5195

Closed
2 tasks done
nickdeakin opened this issue Jul 20, 2022 · 0 comments · Fixed by npm/run-script#98
Closed
2 tasks done
Labels
Bug thing that needs fixing platform:windows is Windows-specific Priority 1 high priority issue Release 8.x work is associated with a specific npm 8 release

Comments

@nickdeakin
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

When running an npm script, in npm 8.14.0 (also 8.13.x) which iterates a directory, the iteration does not happen. The script does not seem to be parsed correctly.

The script with the iteration is:
for /D %D in (*) do (echo installing for %D & cd %D & npm install & cd ..);

This worked up to npm 8.12.2

Expected Behavior

The script is parsed as if it was run directly in cli and the iteration is executed correctly

Steps To Reproduce

  1. In this environment...
  • Windows 10
  • node 16.15.1
  • npm 8.14.0
  1. With this config...
"scripts": {
	"bundle": "npm run install:all",
	"install:all": "for /D %D in (*) do (echo installing for %D & cd %D & npm install & cd ..);"
}
  1. Run '...'
    npm run bundle

  2. See error...
    D was unexpected at this time.

Environment

  • npm: 8.14.0
  • Node.js: 16.15.1
  • OS Name: Windows 10
  • System Model Name: dell precision 3551
  • npm config:
npm config ls
; "user" config from C:\Users\ndeakin\.npmrc                

# using a private corporate registry
  
; node bin location = C:\Program Files\nodejs\node.exe                                 
; node version = v16.15.1                                                              
; npm local prefix = C:\Users\ndeakin\Documents\git\devx\frontend\admin-console        
; npm version = 8.14.0                                                                 
; cwd = C:\Users\ndeakin\Documents\git\devx\frontend\admin-console                     
; HOME = C:\Users\ndeakin                                                              
; Run `npm config ls -l` to show all defaults.     
@nickdeakin nickdeakin added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Jul 20, 2022
@wraithgar wraithgar added platform:windows is Windows-specific Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing platform:windows is Windows-specific Priority 1 high priority issue Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants