I am currently working on a CLI to bootstrap react apps but I've run into a problem! I previously had made it in typescript and then I moved it over to javascript, like fully deleting everything and then making a fresh javascript project in that same directory and when I run any npm or yarn commands like npm start or any script that has to start a file is giving this output:
npm ERR! code ENOTDIR
npm ERR! path D:\Projects\npm-packages\reactize\index.js
npm ERR! ENOTDIR invalid cwd D:\Projects\Github projects\reactize\index.js
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sinha\AppData\Local\npm-cache\_logs\2021-07-01T04_30_47_911Z-debug.log
After This, I moved it over to a different directory thinking it will solve the problem but it didn't! exact same output with just the path difference now pointing to the folder I moved the project over to! Even npm publish is failing with the same error. Here is the full log:
0 verbose cli [
0 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'publish'
0 verbose cli ]
1 info using npm#7.6.0
2 info using node#v15.11.0
3 timing config:load:defaults Completed in 3ms
4 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 7ms
5 timing config:load:builtin Completed in 8ms
6 timing config:load:cli Completed in 3ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:D:\Projects\Github projects\reactize\.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:C:\Users\sinha\.npmrc Completed in 1ms
11 timing config:load:user Completed in 2ms
12 timing config:load:file:C:\Users\sinha\AppData\Roaming\npm\etc\npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 1ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 1ms
17 timing config:load:setEnvs Completed in 2ms
18 timing config:load Completed in 22ms
19 verbose npm-session 861e538ded110b88
20 timing npm:load Completed in 44ms
21 verbose publish [ '.' ]
22 timing command:publish Completed in 14ms
23 verbose stack Error: ENOTDIR invalid cwd D:\Projects\Github projects\reactize\index.js
23 verbose stack at Glob._readdirError (C:\Program Files\nodejs\node_modules\npm\node_modules\glob\glob.js:592:21)
23 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\glob\glob.js:553:12
23 verbose stack at go$readdir$cb (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:214:14)
23 verbose stack at FSReqCallback.oncomplete (node:fs:190:23)
24 verbose cwd D:\Projects\Github projects\reactize
25 verbose Windows_NT 10.0.19042
26 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "publish"
27 verbose node v15.11.0
28 verbose npm v7.6.0
29 error code ENOTDIR
30 error path D:\Projects\Github projects\reactize\index.js
31 error ENOTDIR invalid cwd D:\Projects\Github projects\reactize\index.js
32 verbose exit 1
and here is the package.json:
{
"name": "reactize",
"version": "2.0.0",
"description": "A simple way to bootstrap your react apps!",
"main": "index.js",
"directories": {
"lib": "lib",
"bin": "index.js"
},
"scripts": {
"start": "node .",
"test": "jest",
"path": "yarn version --patch",
"minor": "yarn version --minor",
"major": "yarn version --major",
"prepublishOnly": "node scripts/genTemplateFiles.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/YT-GameWorks/reactize.git"
},
"keywords": [
"cli",
"boilerplate",
"electron",
"react",
"typescript"
],
"author": "Game Glide <sinha.soham#outlook.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/YT-GameWorks/reactize/issues"
},
"homepage": "https://github.com/YT-GameWorks/reactize#readme",
"dependencies": {
"chalk": "^4.1.1",
"consola": "^2.15.3",
"enquirer": "^2.3.6",
"execa": "^5.1.1",
"fs-extra": "^10.0.0",
"jest": "^27.0.6",
"listr": "^0.14.3"
}
}
It's worth noting that scripts like yarn major etc.. which have nothing to do with the project work properly.
Related
when installing tailwind I get the following error:
admin#admin-VirtualBox:~/Desktop/Code/react_app/client$ npm install -D tailwindcss postcss autoprefixer
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-app#1.0
npm ERR! Found: autoprefixer#9.7.1
npm ERR! node_modules/autoprefixer
npm ERR! autoprefixer#"^9.6.1" from postcss-preset-env#6.7.0
npm ERR! node_modules/postcss-preset-env
npm ERR! postcss-preset-env#"6.7.0" from react-scripts#3.2.0
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"3.2.0" from the root project
npm ERR! dev autoprefixer#"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev autoprefixer#"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: postcss#8.4.13
npm ERR! node_modules/postcss
npm ERR! peer postcss#"^8.1.0" from autoprefixer#10.4.7
npm ERR! node_modules/autoprefixer
npm ERR! dev autoprefixer#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/admin/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/admin/.npm/_logs/2022-05-17T19_33_57_115Z-debug-0.log
I am using the following package.json file:
{
"name": "react-app",
"version": "1.0",
"private": true,
"dependencies": {
"babel-eslint": "10.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router": "^6.3.0",
"react-scripts": "3.2.0",
"web3": "^1.6.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
This is the fill log:
0 verbose cli [
0 verbose cli '/usr/local/bin/node',
0 verbose cli '/usr/local/bin/npm',
0 verbose cli 'install',
0 verbose cli '-D',
0 verbose cli 'tailwindcss',
0 verbose cli 'postcss',
0 verbose cli 'autoprefixer'
0 verbose cli ]
1 info using npm#8.5.5
2 info using node#v16.15.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 8ms
6 timing config:load:builtin Completed in 8ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/admin/Desktop/Code/react_app/client/.npmrc Completed in 0ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:/home/admin/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 14ms
19 timing npm:load:configload Completed in 14ms
20 timing npm:load:setTitle Completed in 0ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:display Completed in 3ms
23 verbose logfile /home/admin/.npm/_logs/2022-05-17T19_33_57_115Z-debug-0.log
24 timing npm:load:logFile Completed in 2ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 19ms
28 timing arborist:ctor Completed in 1ms
29 silly logfile start cleaning logs, removing 1 files
30 timing idealTree:init Completed in 769ms
31 timing idealTree:userRequests Completed in 1ms
32 silly idealTree buildDeps
33 silly fetch manifest tailwindcss#*
34 timing arborist:ctor Completed in 0ms
35 http fetch GET 200 https://registry.npmjs.org/tailwindcss 796ms (cache hit)
36 silly fetch manifest postcss#*
37 http fetch GET 200 https://registry.npmjs.org/postcss 8ms (cache hit)
38 silly fetch manifest autoprefixer#*
39 http fetch GET 200 https://registry.npmjs.org/autoprefixer 5ms (cache hit)
40 timing idealTree Completed in 1610ms
41 timing command:install Completed in 1615ms
42 verbose stack Error: could not resolve
42 verbose stack at PlaceDep.failPeerConflict (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/place-dep.js:546:25)
42 verbose stack at PlaceDep.place (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/place-dep.js:197:21)
42 verbose stack at new PlaceDep (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/place-dep.js:71:10)
42 verbose stack at /usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:964:31
42 verbose stack at Array.map (<anonymous>)
42 verbose stack at Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:964:8)
42 verbose stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/build-ideal-tree.js:216:7)
42 verbose stack at async Promise.all (index 1)
42 verbose stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/#npmcli/arborist/lib/arborist/reify.js:153:5)
42 verbose stack at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:159:5)
43 verbose cwd /home/admin/Desktop/Code/react_app/client
44 verbose Linux 5.13.0-40-generic
45 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-D" "tailwindcss" "postcss" "autoprefixer"
46 verbose node v16.15.0
47 verbose npm v8.5.5
48 error code ERESOLVE
49 error ERESOLVE could not resolve
50 error
51 error While resolving: [1mreact-app[22m#[1m1.0[22m
51 error Found: [1mautoprefixer[22m#[1m9.7.1[22m[2m[22m
51 error [2mnode_modules/autoprefixer[22m
51 error [1mautoprefixer[22m#"[1m^9.6.1[22m" from [1mpostcss-preset-env[22m#[1m6.7.0[22m[2m[22m
51 error [2mnode_modules/postcss-preset-env[22m
51 error [1mpostcss-preset-env[22m#"[1m6.7.0[22m" from [1mreact-scripts[22m#[1m3.2.0[22m[2m[22m
51 error [2mnode_modules/react-scripts[22m
51 error [1mreact-scripts[22m#"[1m3.2.0[22m" from the root project
51 error [33mdev[39m [1mautoprefixer[22m#"[1m*[22m" from the root project
51 error
51 error Could not resolve dependency:
51 error [33mdev[39m [1mautoprefixer[22m#"[1m*[22m" from the root project
51 error
51 error Conflicting peer dependency: [1mpostcss[22m#[1m8.4.13[22m[2m[22m
51 error [2mnode_modules/postcss[22m
51 error [35mpeer[39m [1mpostcss[22m#"[1m^8.1.0[22m" from [1mautoprefixer[22m#[1m10.4.7[22m[2m[22m
51 error [2mnode_modules/autoprefixer[22m
51 error [33mdev[39m [1mautoprefixer[22m#"[1m*[22m" from the root project
51 error
51 error Fix the upstream dependency conflict, or retry
51 error this command with --force, or --legacy-peer-deps
51 error to accept an incorrect (and potentially broken) dependency resolution.
51 error
51 error See /home/admin/.npm/eresolve-report.txt for a full report.
52 verbose exit 1
53 timing npm Completed in 1755ms
54 verbose unfinished npm timer reify 1652816037244
55 verbose unfinished npm timer reify:loadTrees 1652816037246
56 verbose unfinished npm timer idealTree:buildDeps 1652816038016
57 verbose unfinished npm timer idealTree:#root 1652816038016
58 verbose code 1
59 error A complete log of this run can be found in:
59 error /home/admin/.npm/_logs/2022-05-17T19_33_57_115Z-debug-0.log
Any suggestions what I am doing wrong?
I appreciate your replies!
Your problem lies in using multiple conflicting versions of autoprefixer. Those come from different packages, for instance react-scripts. I noticed that, while your react is pretty up-to-date, your react-scripts are two major versions behind (3.2.0 vs. 5.0.1). This means there have been two times breaking changes in between, which could easily explain the conflict. If you aren't sure what that means, head over to Semver for an explanation.
I can't possibly tell if this is going to resolve the problem, but I would make a quick copy of the project, remove all dependencies from package.json and run npm i babel-eslint react react-dom react-router react-scripts web3. There are more sophisticated ways to do this, but this would quickly tell you, if updating all packages fixes the problem.
This is my first time using nodejs, I am getting the following error while running npm run start command. Is there a version compatibility issue between node and npm? I can see that the end lines suggesting this is not an issue with npm.
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/iamuser/.nvm/versions/node/v14.17.6/bin/node',
1 verbose cli '/home/iamuser/.nvm/versions/node/v14.17.6/bin/npm',
1 verbose cli 'run',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.14.15
3 info using node#v14.17.6
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle test-api#1.0.0~prestart: test-api#1.0.0
6 info lifecycle test-api#1.0.0~start: test-api#1.0.0
7 verbose lifecycle test-api#1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle test-api#1.0.0~start: PATH: /home/iamuser/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/iamuser/Documents/JS/rapid_api/test-api/node_modules/.bin:/home/iamuser/.nvm/versions/node/v14.17.6/bin:/home/iamuser/anaconda3/bin:/home/iamuser/anaconda3/condabin:/home/iamuser/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle test-api#1.0.0~start: CWD: /home/iamuser/Documents/JS/rapid_api/test-api
10 silly lifecycle test-api#1.0.0~start: Args: [ '-c', 'nodemon index.js' ]
11 info lifecycle test-api#1.0.0~start: Failed to exec start script
12 verbose stack Error: test-api#1.0.0 start: `nodemon index.js`
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (/home/iamuser/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:400:28)
12 verbose stack at maybeClose (internal/child_process.js:1055:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
13 verbose pkgid test-api#1.0.0
14 verbose cwd /home/iamuser/Documents/JS/rapid_api/test-api
15 verbose Linux 5.11.0-44-generic
16 verbose argv "/home/iamuser/.nvm/versions/node/v14.17.6/bin/node" "/home/iamuser/.nvm/versions/node/v14.17.6/bin/npm" "run" "start"
17 verbose node v14.17.6
18 verbose npm v6.14.15
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error test-api#1.0.0 start: `nodemon index.js`
23 error spawn ENOENT
24 error Failed at the test-api#1.0.0 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
package.json:
{
"name": "test-api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "nodemon index.js"
},
"author": "iamuser",
"license": "ISC",
"dependencies": {
"axios": "^0.24.0",
"cheerio": "^1.0.0-rc.10",
"express": "^4.17.1"
}
}
As #ndenasie said, nodemon isn't installed. Try running npm install -g nodemon then npm run start and it should work.
Since the comment worked, this is just a response for you to mark as the best answer to close the thread.
I have tried npm clear cache --force, removing node_modules/ and package-lock.json and then again npm install and then npm build and finally npm run dev. But unfortunately this failed around 5-6 times.
My Errors:
npm ERR! errno 1
npm ERR! with-redux-toolkit#1.0.0 build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the with-redux-toolkit#1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\divya\AppData\Roaming\npm-cache\_logs\2021-08-25T14_05_46_415Z-debug.log
My debug logs:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run-script',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.14.14
3 info using node#v14.17.4
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle with-redux-toolkit#1.0.0~prebuild: with-redux-toolkit#1.0.0
6 info lifecycle with-redux-toolkit#1.0.0~build: with-redux-toolkit#1.0.0
7 verbose lifecycle with-redux-toolkit#1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle with-redux-toolkit#1.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;M:\Amazon-starter-template-nextjs\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Users\divya\AppData\Local\Programs\AdoptOpenJDK\jdk-11.0.11.9-hotspot\bin;C:\Users\divya\AppData\Local\Microsoft\WindowsApps;;C:\Users\divya\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\divya\AppData\Roaming\npm
9 verbose lifecycle with-redux-toolkit#1.0.0~build: CWD: M:\Amazon-starter-template-nextjs
10 silly lifecycle with-redux-toolkit#1.0.0~build: Args: [ '/d /s /c', 'next build' ]
11 silly lifecycle with-redux-toolkit#1.0.0~build: Returned: code: 1 signal: null
12 info lifecycle with-redux-toolkit#1.0.0~build: Failed to exec build script
13 verbose stack Error: with-redux-toolkit#1.0.0 build: `next build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid with-redux-toolkit#1.0.0
15 verbose cwd M:\Amazon-starter-template-nextjs
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "build"
18 verbose node v14.17.4
19 verbose npm v6.14.14
20 error code ELIFECYCLE
21 error errno 1
22 error with-redux-toolkit#1.0.0 build: `next build`
22 error Exit status 1
23 error Failed at the with-redux-toolkit#1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
My package.json file:
{
"name": "with-redux-toolkit",
"version": "1.0.0",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"#heroicons/react": "^1.0.4",
"#reduxjs/toolkit": "1.5.0",
"#tailwindcss/line-clamp": "^0.2.0",
"firebase": "^8.6.1",
"firebase-admin": "^9.8.0",
"heroicons-react": "^1.4.1",
"hoist-non-react-statics": "^3.3.2",
"next": "^11.1.0",
"next-fonts": "^1.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "7.2.2"
},
"license": "MIT",
"devDependencies": {
"autoprefixer": "^10.2.5",
"postcss": "^8.2.15",
"tailwindcss": "^2.2.7"
}
}
As the error says itself, this is not a problem with NPM. Only we have to do is
instead of,
npm run build -prod
extend the javascript memory by following,
node --max_old_space_size=4096 node_modules/#angular/cli/bin/ng build --prod
npm install --cache /tmp/empty-cache
npm run build
(I tried cache clean but not work)
I'm trying to transpile an ES6 file using Babel - but NPM doesn't like the command babel src --out-dir output which is run using a script in my package.json.
However, when I install Babel globally and run the same command without using the script, it works just fine.
I would like to avoid installing Babel globally if I don't have to.
Error (see debug log below)
TypeError: src/person.js: Expected 'input' to be a 'string', got 'number'
And looks like the command babel src --out-dir output "fails on your system"
Project setup
-> root
-> node_modules
-> output
-> src
- person.js
- .babelrc
- package.json
package.json
{
"name": "Test",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "babel src --out-dir output"
},
"author": "Me",
"license": "UNLICENSED",
"devDependencies": {
"babel-cli": "~6.11.4",
"babel-preset-es2015": "^6.9.0"
}
}
person.js
class Person {
constructor(name) {
this.name = name;
}
}
.babelrc
{
"presets": ["es2015"]
}
Debug log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\node.exe',
1 verbose cli 'C:\\Program Files (x86)\\node_modules\\npm\\bin\\npmcli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm#2.15.8
3 info using node#v4.4.7
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info prebuild Codemode#0.0.0
6 info build Test#0.0.0
7 verbose unsafe-perm in lifecycle true
8 info Test#0.0.0 Failed to exec build script
9 verbose stack Error: Test#0.0.0 build: `babel src --out-dir output`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (C:\Program Files (x86)\node_modules\npm\lib\utils\lifecycle.js:217:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess.<anonymous> (C:\Program Files (x86)\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:827:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid Codemode#0.0.0
11 verbose cwd C:\Users\me\Dev\Test
12 error Windows_NT 6.1.7601
13 error argv "C:\\Program Files (x86)\\node.exe" "C:\\Program Files (x86)\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
14 error node v4.4.7
15 error npm v2.15.8
16 error code ELIFECYCLE
17 error Test#0.0.0 build: `babel src --out-dir output`
17 error Exit status 1
18 error Failed at the Test#0.0.0 build script 'babel src --out-dir output'.
18 error This is most likely a problem with the Test package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error babel src --out-dir output
18 error You can get information on how to open an issue for this project with:
18 error npm bugs Test
18 error Or if that isn't available, you can get their info via:
18 error
18 error npm owner ls Test
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
I'm really not sure where this is going wrong, and can't find any posts on the error.
Thanks for your help
Problem solved (by fluke)!
I'm still unsure what the issue was, however I have since added webpack to my project, and added a further script to run the webpack command. This worked fine, so I tried the npm run build command again and it worked (I checked and babel-cli -g was uninstalled too).
If anyone can shed any light on what went wrong, that would be great!!!
Thanks
I'm new with Angular 2 and I have some errors while launching a basic app. I just create a new component and boostrap it. Nothing more.
Here is my package.json :
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install"
},
"license": "ISC",
"dependencies": {
"#ngrx/store": "^1.3.3",
"angular2": "2.0.0-beta.9",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.24",
"zone.js": "0.5.15"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.1.0",
"typescript": "^1.8.7",
"typings": "^0.7.5"
}
}
I have the latests versions of node & npm. I also installed globally the devDependencies.
My error log when I tried to npm run tsc:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'tsc' ]
2 info using npm#3.7.3
3 info using node#v5.8.0
4 verbose run-script [ 'pretsc', 'tsc', 'posttsc' ]
5 info lifecycle angular2-quickstart#1.0.0~pretsc: angular2-quickstart#1.0.0
6 silly lifecycle angular2-quickstart#1.0.0~pretsc: no script for pretsc, continuing
7 info lifecycle angular2-quickstart#1.0.0~tsc: angular2-quickstart#1.0.0
8 verbose lifecycle angular2-quickstart#1.0.0~tsc: unsafe-perm in lifecycle true
9 verbose lifecycle angular2-quickstart#1.0.0~tsc: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\__\mdev\node_modules\.bin;C:\Program Files\nodejs;C:\cmder\bin;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\share\vim\vim74;C:\cmder\vendor\conemu-maximus5;C:\cmder\vendor\conemu-maximus5\ConEmu;C:\Ruby22-x64\bin;C:\Program Files (x86)\OpenSSH\bin;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\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\nodejs\;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\;C:\Users\cflodrops\Downloads\windows-7.0.0\windrush;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files\Oracle\VirtualBox;C:\Program Files\Git\bin;C:\MinGW\bin;C:\wamp\bin\mysql\mysql5.6.17\bin;C:\Users\cflodrops\AppData\Local\atom\bin;C:\ProgramData\Drush\;C:\Program Files (x86)\Drush\GnuWin32\bin;C:\Program Files (x86)\Drush\Php;C:\Program Files (x86)\Drush\cwRsync\bin;C:\Program Files (x86)\Microsoft VS Code\bin;\\sdossier.groupe.zzroot.com\dossiers$\cflodrops\AppData\npm;C:\cmder
10 verbose lifecycle angular2-quickstart#1.0.0~tsc: CWD: D:\__\mdev
11 silly lifecycle angular2-quickstart#1.0.0~tsc: Args: [ '/d /s /c', 'tsc' ]
12 silly lifecycle angular2-quickstart#1.0.0~tsc: Returned: code: 2 signal: null
13 info lifecycle angular2-quickstart#1.0.0~tsc: Failed to exec tsc script
14 verbose stack Error: angular2-quickstart#1.0.0 tsc: `tsc`
14 verbose stack Exit status 2
14 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:239:16)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at EventEmitter.emit (events.js:185:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at ChildProcess.emit (events.js:185:7)
14 verbose stack at maybeClose (internal/child_process.js:850:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid angular2-quickstart#1.0.0
16 verbose cwd D:\__\mdev
17 error Windows_NT 6.1.7601
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "tsc"
19 error node v5.8.0
20 error npm v3.7.3
21 error code ELIFECYCLE
22 error angular2-quickstart#1.0.0 tsc: `tsc`
22 error Exit status 2
23 error Failed at the angular2-quickstart#1.0.0 tsc script 'tsc'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the angular2-quickstart package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error tsc
23 error You can get information on how to open an issue for this project with:
23 error npm bugs angular2-quickstart
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls angular2-quickstart
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
And when I execute npm start:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'lite' ]
2 info using npm#3.7.3
3 info using node#v5.8.0
4 verbose run-script [ 'prelite', 'lite', 'postlite' ]
5 info lifecycle angular2-quickstart#1.0.0~prelite: angular2-quickstart#1.0.0
6 silly lifecycle angular2-quickstart#1.0.0~prelite: no script for prelite, continuing
7 info lifecycle angular2-quickstart#1.0.0~lite: angular2-quickstart#1.0.0
8 verbose lifecycle angular2-quickstart#1.0.0~lite: unsafe-perm in lifecycle true
9 verbose lifecycle angular2-quickstart#1.0.0~lite: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\__\mdev\node_modules\.bin;C:\Program Files\nodejs;C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\__\mdev\node_modules\.bin;C:\Program Files\nodejs;C:\cmder\bin;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\share\vim\vim74;C:\cmder\vendor\conemu-maximus5;C:\cmder\vendor\conemu-maximus5\ConEmu;C:\Ruby22-x64\bin;C:\Program Files (x86)\OpenSSH\bin;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\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\nodejs\;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\;C:\Users\cflodrops\Downloads\windows-7.0.0\windrush;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files\Oracle\VirtualBox;C:\Program Files\Git\bin;C:\MinGW\bin;C:\wamp\bin\mysql\mysql5.6.17\bin;C:\Users\cflodrops\AppData\Local\atom\bin;C:\ProgramData\Drush\;C:\Program Files (x86)\Drush\GnuWin32\bin;C:\Program Files (x86)\Drush\Php;C:\Program Files (x86)\Drush\cwRsync\bin;C:\Program Files (x86)\Microsoft VS Code\bin;\\sdossier.groupe.zzroot.com\dossiers$\cflodrops\AppData\npm;C:\cmder
10 verbose lifecycle angular2-quickstart#1.0.0~lite: CWD: D:\__\mdev
11 silly lifecycle angular2-quickstart#1.0.0~lite: Args: [ '/d /s /c', 'lite-server' ]
12 silly lifecycle angular2-quickstart#1.0.0~lite: Returned: code: 1 signal: null
13 info lifecycle angular2-quickstart#1.0.0~lite: Failed to exec lite script
14 verbose stack Error: angular2-quickstart#1.0.0 lite: `lite-server`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:239:16)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at EventEmitter.emit (events.js:185:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at ChildProcess.emit (events.js:185:7)
14 verbose stack at maybeClose (internal/child_process.js:850:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid angular2-quickstart#1.0.0
16 verbose cwd D:\__\mdev
17 error Windows_NT 6.1.7601
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "lite"
19 error node v5.8.0
20 error npm v3.7.3
21 error code ELIFECYCLE
22 error angular2-quickstart#1.0.0 lite: `lite-server`
22 error Exit status 1
23 error Failed at the angular2-quickstart#1.0.0 lite script 'lite-server'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the angular2-quickstart package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error lite-server
23 error You can get information on how to open an issue for this project with:
23 error npm bugs angular2-quickstart
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls angular2-quickstart
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
Okay so the issue comes from lite-server. I've decided to install http-server and change my package.json like that :
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "concurrently \"npm run tsc:w\" \"npm run http\" ",
"tsc": "tsc -p .",
"tsc:w": "tsc -w -p .",
"lite": "nano-server",
"http": "http-server -p 3000 -a 127.0.0.1 -o",
"typings": "typings",
"postinstall": "typings install"
},
"license": "ISC",
"dependencies": {
"#ngrx/store": "^1.3.3",
"angular2": "2.0.0-beta.9",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.24",
"zone.js": "0.5.15"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.1.0",
"http-server": "^0.9.0",
"typescript": "^1.8.7",
"typings": "^0.7.5"
}
}
And it works. Thanks for your help !