eshcol
eshcol

Reputation: 569

NativeScript tns create fails - At POSTINSTALL Script

I try to create a new project with the following command, the folders first get created and by the end gets deleted. The project is NOT created finally. I just see a package-lock.json at the end

I'm editing this post with a pattern I've recently been seeing. Just for a Change I tried doing TNS CREATE with VUE JS, it fails exactly in the POSTINSTALL JS script.

Any idea what I can do to get rid of this issue. This has been wasting my time for over 2 days now.

Here is the log

EDIT --- NEW LOG WITH Node Version 10 Eshcols-iMac:NativeScript eshcol$ sudo tns create

Let’s create a NativeScript app!

Answer the following questions to help us build the right app for you. (Note: you can skip this prompt next time using the --template option, or the --ng, --vue, --ts, or --js flags.)

? First, what will be the name of your app? TestApp

? Next, which style of NativeScript project would you like to use: Angular

? Finally, which template would you like to start from: Hello World

[email protected] install /Users/eshcol/NativeScript/TestApp/node_modules/fsevents node install

node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib' gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/build' gyp ERR! System Darwin 17.7.0 gyp ERR! command "/usr/local/Cellar/node@10/10.15.0/bin/node" "/usr/local/Cellar/node@10/10.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64" "--napi_version=3" "--node_abi_napi=napi" gyp ERR! cwd /Users/eshcol/NativeScript/TestApp/node_modules/fsevents gyp ERR! node -v v10.15.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node@10/10.15.0/bin/node /usr/local/Cellar/node@10/10.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1) node-pre-gyp ERR! stack at ChildProcess. (/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:962:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) node-pre-gyp ERR! System Darwin 17.7.0 node-pre-gyp ERR! command "/usr/local/Cellar/node@10/10.15.0/bin/node" "/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /Users/eshcol/NativeScript/TestApp/node_modules/fsevents node-pre-gyp ERR! node -v v10.15.0 node-pre-gyp ERR! node-pre-gyp -v v0.10.3 node-pre-gyp ERR! not ok Failed to execute '/usr/local/Cellar/node@10/10.15.0/bin/node /usr/local/Cellar/node@10/10.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)

[email protected] postinstall /Users/eshcol/NativeScript/TestApp/node_modules/nativescript-angular node postinstall.js

fs.js:115 throw err; ^

Error: EACCES: permission denied, mkdir '/Users/eshcol/NativeScript/TestApp/hooks' at Object.mkdirSync (fs.js:753:3) at Object. (/Users/eshcol/NativeScript/TestApp/node_modules/nativescript-angular/postinstall.js:11:12) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node install npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall: node postinstall.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall 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! /Users/eshcol/.npm/_logs/2019-02-02T15_47_24_931Z-debug.log Command npm failed with exit code 1

tns create

Upvotes: 0

Views: 461

Answers (1)

Kaushik Makwana
Kaushik Makwana

Reputation: 2576

To fix project creation in general you can try sudo chown -R username /home/username/.npm This should allow you to run tns create MyApp without adding sudo.

Upvotes: 0

Related Questions