NativeScript's installation script error: "expected types/qr-image but found @types/qr-image"


#1

I’m getting some troubles to install NativeScript on a Debian/GNU Linux, following Getting Started guide.

The command I use :

# npm install -g nativescript

And the interresting part of the log :

# tail npm-debug.log -n 50
22533 silly gunzTarPerm modified mode [ 'lib/lib.es2015.d.ts', 438, 420 ]
22534 silly gunzTarPerm extractEntry lib/lib.es2015.core.d.ts
22535 silly gunzTarPerm modified mode [ 'lib/lib.es2015.core.d.ts', 438, 420 ]
22536 silly gunzTarPerm extractEntry lib/tsserverlibrary.d.ts
22537 silly gunzTarPerm modified mode [ 'lib/tsserverlibrary.d.ts', 438, 420 ]
22538 silly gunzTarPerm extractEntry lib/lib.es2015.collection.d.ts
22539 silly gunzTarPerm modified mode [ 'lib/lib.es2015.collection.d.ts', 438, 420 ]
22540 silly gunzTarPerm extractEntry lib/typescript.d.ts
22541 silly gunzTarPerm modified mode [ 'lib/typescript.d.ts', 438, 420 ]
22542 silly gunzTarPerm extractEntry lib/lib.dom.iterable.d.ts
22543 silly gunzTarPerm modified mode [ 'lib/lib.dom.iterable.d.ts', 438, 420 ]
22544 silly gunzTarPerm extractEntry lib/typescriptServices.d.ts
22545 silly gunzTarPerm modified mode [ 'lib/typescriptServices.d.ts', 438, 420 ]
22546 silly gunzTarPerm extractEntry lib/lib.dom.d.ts
22547 silly gunzTarPerm modified mode [ 'lib/lib.dom.d.ts', 438, 420 ]
22548 silly gunzTarPerm extractEntry lib/lib.d.ts
22549 silly gunzTarPerm modified mode [ 'lib/lib.d.ts', 438, 420 ]
22550 silly gunzTarPerm extractEntry lib/lib.es2017.object.d.ts
22551 silly gunzTarPerm modified mode [ 'lib/lib.es2017.object.d.ts', 438, 420 ]
22552 silly gunzTarPerm extractEntry test.config
22553 silly gunzTarPerm modified mode [ 'test.config', 438, 420 ]
22554 silly gunzTarPerm extractEntry yarn.lock
22555 silly gunzTarPerm modified mode [ 'yarn.lock', 438, 420 ]
22556 silly lockFile 2b770199-ript-typescript-2-4-1-tgz-unpack tar:///tmp/npm-2511-JjuqWHHc/registry.npmjs.org/typescript/-/typescript-2.4.1.tgz-unpack
22557 silly lockFile 2b770199-ript-typescript-2-4-1-tgz-unpack tar:///tmp/npm-2511-JjuqWHHc/registry.npmjs.org/typescript/-/typescript-2.4.1.tgz-unpack
22558 silly lockFile 3a4c1d5c--typescript-typescript-2-4-1-tgz tar:///tmp/npm-2511-JjuqWHHc/registry.npmjs.org/typescript/-/typescript-2.4.1.tgz
22559 silly lockFile 3a4c1d5c--typescript-typescript-2-4-1-tgz tar:///tmp/npm-2511-JjuqWHHc/registry.npmjs.org/typescript/-/typescript-2.4.1.tgz
22560 silly lockFile d75d5c9e--typescript-typescript-2-4-1-tgz https://registry.npmjs.org/typescript/-/typescript-2.4.1.tgz
22561 silly lockFile d75d5c9e--typescript-typescript-2-4-1-tgz https://registry.npmjs.org/typescript/-/typescript-2.4.1.tgz
22562 verbose about to build /usr/local/lib/node_modules/nativescript
22563 verbose lib/node_modules/nativescript unbuild
22564 info preuninstall nativescript@3.4.3
22565 verbose unsafe-perm in lifecycle false
22566 info uninstall nativescript@3.4.3
22567 verbose true,/usr/local/lib/node_modules,/usr/local/lib/node_modules unbuild nativescript@3.4.3
22568 verbose /usr/local/bin,[object Object] binRoot
22569 info postuninstall nativescript@3.4.3
22570 error Error: Invalid Package: expected types/qr-image but found @types/qr-image
22570 error     at /usr/share/npm/lib/cache/add-local-tarball.js:161:14
22570 error     at _combinedTickCallback (internal/process/next_tick.js:131:7)
22570 error     at process._tickCallback (internal/process/next_tick.js:180:9)
22571 error If you need help, you may report this *entire* log,
22571 error including the npm and node versions, at:
22571 error     <http://github.com/npm/npm/issues>
22572 error System Linux 4.15.0-2-amd64
22573 error command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "nativescript"
22574 error cwd /home/pilou
22575 error node -v v8.9.3
22576 error npm -v 1.4.21
22577 verbose exit [ 1, true ]

When I’m searching about that on Google, I don’t find much except a Json misconfiguration for Yarn…

I already tried npm install -g nativescript --unsafe-perm found in NativeScript Advanced Setup guide and to install manually Yarn (no problem doing that) without result (the package name changes but error is following Yarn install in the log).

I’m new to Node so I’m a bit lost : did I miss some configuration point?

Thank’s for helping and sorry for my approximative english !


#2

For the record, Debian’s npm package was too old. I’ve resolved this issue by installing NodeJS the Node way (on their website). Note that you still have to install it with that command since repo is defined as buster rather than testing :

apt install nodejs/buster