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

Compilation issue node-gyp on Mac ios #123

Closed
yotamshapira opened this issue Apr 14, 2020 · 2 comments
Closed

Compilation issue node-gyp on Mac ios #123

yotamshapira opened this issue Apr 14, 2020 · 2 comments

Comments

@yotamshapira
Copy link

Describe the bug
After generating an application, without modifying its code, I could not start the server due to a compilation issue.

To Reproduce
Steps to reproduce the behavior:

  1. jhipster --blueprints nodejs
  2. Options used:
? What is the base name of your application? <my app's name>
? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
? Which *production* database would you like to use? MySQL or MariaDB
? Which *Framework* would you like to use for the client? Angular
? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster
? Would you like to install other generators from the JHipster Marketplace? No
  1. cd server
  2. npm install
    First issue is here, installation was not successful:

> [email protected] install <PATH>/server/node_modules/fsevents
> node-gyp rebuild

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:316:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/Cellar/node/13.10.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd <PATH>/server/node_modules/fsevents
gyp ERR! node -v v13.10.1
gyp ERR! node-gyp -v v5.0.7
gyp ERR! not ok

> [email protected] install <PATH>/server/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.9/node-v79-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v79 ABI, unknown) (falling back to source compile with node-gyp)
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:316:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/Cellar/node/13.10.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=<PATH>/server/node_modules/sqlite3/lib/binding/node-v79-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=<PATH>/server/node_modules/sqlite3/lib/binding/node-v79-darwin-x64" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v79"
gyp ERR! cwd <PATH>/server/node_modules/sqlite3
gyp ERR! node -v v13.10.1
gyp ERR! node-gyp -v v5.0.7
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/13.10.1/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=<PATH>/server/node_modules/sqlite3/lib/binding/node-v79-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=<PATH>/server/node_modules/sqlite3/lib/binding/node-v79-darwin-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (<PATH>/server/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:316:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1026:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Darwin 19.0.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/13.10.1/bin/node" "<PATH>/server/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd <PATH>/server/node_modules/sqlite3
node-pre-gyp ERR! node -v v13.10.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/13.10.1/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=<PATH>/server/node_modules/sqlite3/lib/binding/node-v79-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=<PATH>/server/node_modules/sqlite3/lib/binding/node-v79-darwin-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
npm WARN <MY PROJECT NAME>@0.0.1 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install 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!     <HOME PATH>/.npm/_logs/2020-04-14T15_13_27_062Z-debug.log
  1. npm start
    Crash lopg:
> <MY PROJECT NAME>@0.0.1 start <PATH>/server
> npm run clean && npm run copy-resources && nodemon --watch src -e ts,tsx --exec ts-node src/main.ts


> <MY PROJECT NAME>@0.0.1 clean <PATH>/server
> rimraf dist


> <MY PROJECT NAME>@0.0.1 copy-resources <PATH>/server
> ts-node scripts/copy-resources.ts

[nodemon] 1.19.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: <PATH>/server/src/**/*
[nodemon] starting `ts-node src/main.ts`

<PATH>/server/node_modules/ts-node/src/index.ts:240
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/web/rest/user.controller.ts:29:54 - error TS2345: Argument of type 'string | string[] | Query | Query[]' is not assignable to parameter of type 'string | number'.
  Type 'string[]' is not assignable to type 'string | number'.
    Type 'string[]' is not assignable to type 'string'.

29     const pageRequest: PageRequest = new PageRequest(req.query.page, req.query.size, req.query.sort);
                                                        ~~~~~~~~~~~~~~

    at createTSError (<PATH>/server/node_modules/ts-node/src/index.ts:240:12)
    at reportTSError (<PATH>/server/node_modules/ts-node/src/index.ts:244:19)
    at getOutput (<PATH>/server/node_modules/ts-node/src/index.ts:360:34)
    at Object.compile (<PATH>/server/node_modules/ts-node/src/index.ts:393:11)
    at Module.m._compile (<PATH>/server/node_modules/ts-node/src/index.ts:439:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Object.require.extensions.<computed> [as .ts] (<PATH>/server/node_modules/ts-node/src/index.ts:442:12)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
[nodemon] app crashed - waiting for file changes before starting...

Expected behavior
Both client and server should be able to start

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] - MacOS 10.15.1
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
I use NodeJS v13.10.1
generator-jhipster-nodejs 1.0.1
jhipster 6.8.0

@ghost
Copy link

ghost commented Apr 14, 2020

This is linked to #120 , you have to wait for the next release. It is due to an old version of express-serve-static-core. Update the server/package.json with:

"devDependencies": {
    "@types/express-serve-static-core": "4.17.3",

Then, you have some issues on your Mac for node-gyp (an external npm package).

@yotamshapira
Copy link
Author

node-gyp

That indeed solved the issue.
Also, if anyone should encounter the node-gyp issue, I fixed it as described here: https://stackoverflow.com/questions/34617452/how-to-update-xcode-from-command-line

Thanks!

@ghost ghost changed the title Compilation issue on new application Compilation issue node-gyp on Mac ios Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant