An error is encountered when running npm run build
:
'.' is not recognized as an internal or external command, operable program or batch file.
Here is the npm file that contains relevant scripts:
"scripts": {
"postinstall": "jspm install && npm run build",
"start": "http-server",
"build": "./bin/build-code",
"build-home": "./bin/build-home -dw",
"build-common-deps": "./bin/build-common-deps -dw",
"build-navbar": "./bin/build-navbar -dw",
"build-root": "./bin/build-root -dw",
"build-angular1": "./bin/build-angular1 -dw",
"build-react": "./bin/build-react -w",
"build-preact": "./bin/build-preact -dw",
"build-vanilla": "./bin/build-vanillajs",
"build-angular2": "./bin/build-angular2 -dw"
}
The issue seems to be related to pathing for the ./bin/build-code
script location. The expected behavior is the search for files from the same directory as the package.json
. If there is a bin
folder in that directory, then the correct path should lead to the build-code
script within the bin folder. However, this doesn't seem to be working correctly. This problem persists whether using PowerShell or basic Command Prompt to execute npm run build
.
P.S. A colleague also faced a similar issue on Cygwin and mentioned having to "Change dos endings to unix," although it remains unclear how this relates to the current problem.