Npm WARN saveError ENOENT: no such file or directory, open


#1

I cannot get the platformio-ide package to load in the IDE or using apm directly. I can’t get any package to install actually.

I have am not on a proxy’d network.
I am using Ubuntu 18.10 on a VMWARE.
I have even tried the: NODE_TLS_REJECT_UNAUTHORIZED=0 recommended on a bug report.

Tom


#2

The VM could be the issue. Can you install packages in Atom on the host OS?


#3

I can get this to work on the Host which is Wndows 10.

I will look at settings on the vmplayer. I still believe its something that is going on with NPM.

Does anyone know what this NPM error really means? I assume that apm is a wrapper around NPM and all of this package management is implemented in NodeJS which I know nothing about.

Tom


#4

I doubt that the subject of this thread is the entire text of the error. If you share a complete stack trace, I might be able to make an educated guess about the cause of the error.


#5

Thanks for looking at this:

> /usr/share/atom/resources/app/apm/bin/node /usr/share/atom/resources/app/apm/bin/../lib/cli.js install platformio-ide --verbose
> Installing platformio-ide to /home/torsi/.atom/packages REQUEST { url: 'https://atom.io/api/packages/platformio-ide',
>   json: true,
>   retries: 4,
>   strictSSL: true,
>   headers: { 'User-Agent': 'npm/6.2.0 node/v8.9.3 linux x64' },
>   callback: [Function],
>   method: 'GET' }
> REQUEST make request https://atom.io/api/packages/platformio-ide
> REQUEST onRequestResponse https://atom.io/api/packages/platformio-ide 200 { server: 'Cowboy',
>   connection: 'close',
>   date: 'Tue, 23 Oct 2018 19:33:21 GMT',
>   status: '200 OK',
>   'x-frame-options': 'DENY',
>   'x-xss-protection': '1; mode=block',
>   'x-content-type-options': 'nosniff',
>   'strict-transport-security': 'max-age=31536000',
>   'content-security-policy': 'default-src \'self\'; connect-src \'self\'; font-src https://github-atom-io-herokuapp-com.freetls.fastly.net https://github-atom-io-herokuapp-com.global.ssl.fastly.net; frame-src \'self\' https://www.youtube.com; img-src https://* \'self\' https://github-atom-io-herokuapp-com.freetls.fastly.net data:; media-src \'self\'; object-src \'self\' https://github-atom-io-herokuapp-com.freetls.fastly.net; script-src \'self\' \'unsafe-inline\' https://ssl.google-analytics.com https://www.google-analytics.com https://platform.twitter.com https://github-atom-io-herokuapp-com.freetls.fastly.net; style-src \'self\' \'unsafe-inline\' https://github-atom-io-herokuapp-com.freetls.fastly.net;',
>   'content-type': 'application/json; charset=utf-8',
>   etag: 'W/"0288a2dfdec17535d56e5ab0941b05e7"',
>   'cache-control': 'max-age=0, private, must-revalidate',
>   'x-request-id': '75060d24-161b-4df2-b91b-a27eedc0fffd',
>   'x-runtime': '0.008397',
>   'x-rack-cache': 'miss',
>   vary: 'Accept-Encoding, Origin',
>   via: '1.1 vegur' }
> REQUEST reading response's body
> REQUEST finish init function https://atom.io/api/packages/platformio-ide
> REQUEST response end https://atom.io/api/packages/platformio-ide 200 { server: 'Cowboy',
>   connection: 'close',
>   date: 'Tue, 23 Oct 2018 19:33:21 GMT',
>   status: '200 OK',
>   'x-frame-options': 'DENY',
>   'x-xss-protection': '1; mode=block',
>   'x-content-type-options': 'nosniff',
>   'strict-transport-security': 'max-age=31536000',
>   'content-security-policy': 'default-src \'self\'; connect-src \'self\'; font-src https://github-atom-io-herokuapp-com.freetls.fastly.net https://github-atom-io-herokuapp-com.global.ssl.fastly.net; frame-src \'self\' https://www.youtube.com; img-src https://* \'self\' https://github-atom-io-herokuapp-com.freetls.fastly.net data:; media-src \'self\'; object-src \'self\' https://github-atom-io-herokuapp-com.freetls.fastly.net; script-src \'self\' \'unsafe-inline\' https://ssl.google-analytics.com https://www.google-analytics.com https://platform.twitter.com https://github-atom-io-herokuapp-com.freetls.fastly.net; style-src \'self\' \'unsafe-inline\' https://github-atom-io-herokuapp-com.freetls.fastly.net;',
>   'content-type': 'application/json; charset=utf-8',
>   etag: 'W/"0288a2dfdec17535d56e5ab0941b05e7"',
>   'cache-control': 'max-age=0, private, must-revalidate',
>   'x-request-id': '75060d24-161b-4df2-b91b-a27eedc0fffd',
>   'x-runtime': '0.008397',
>   'x-rack-cache': 'miss',
>   vary: 'Accept-Encoding, Origin',
>   via: '1.1 vegur' }
> REQUEST end event https://atom.io/api/packages/platformio-ide
> REQUEST has body https://atom.io/api/packages/platformio-ide 52327
> REQUEST emitting complete https://atom.io/api/packages/platformio-ide
> gyp info it worked if it ends with ok
> gyp verb cli [ '/usr/share/atom/resources/app/apm/bin/node',
> gyp verb cli   '/usr/share/atom/resources/app/apm/node_modules/node-gyp/bin/node-gyp.js',
> gyp verb cli   'install',
> gyp verb cli   '--runtime=electron',
> gyp verb cli   '--target=2.0.7',
> gyp verb cli   '--dist-url=https://atom.io/download/electron',
> gyp verb cli   '--arch=x64',
> gyp verb cli   '--ensure',
> gyp verb cli   '--verbose' ]
> gyp info using node-gyp@3.4.0
> gyp info using node@8.9.3 | linux | x64
> gyp verb command install []
> gyp verb install input version string "2.0.7"
> gyp verb install installing version: iojs-2.0.7
> gyp verb install --ensure was passed, so won't reinstall if already installed
> gyp verb install version is already installed, need to check "installVersion"
> gyp verb got "installVersion" 9
> gyp verb needs "installVersion" 9
> gyp verb install version is good
> 2.0.7
> gyp info ok 
> npm WARN saveError ENOENT: no such file or directory, open '/tmp/apm-install-dir-118923-7872-15rsbol.schsh/package.json'
> npm notice created a lockfile as package-lock.json. You should commit this file.
> npm WARN enoent ENOENT: no such file or directory, open '/tmp/apm-install-dir-118923-7872-15rsbol.schsh/package.json'
> npm WARN apm-install-dir-118923-7872-15rsbol.schsh No description
> npm WARN apm-install-dir-118923-7872-15rsbol.schsh No repository field.
> npm WARN apm-install-dir-118923-7872-15rsbol.schsh No README data
> npm WARN apm-install-dir-118923-7872-15rsbol.schsh No license field.
> 
> + platformio-ide@2.2.2
> added 109 packages from 97 contributors and audited 166 packages in 4.729s
> found 0 vulnerabilities

#6
> + platformio-ide@2.2.2
> added 109 packages from 97 contributors and audited 166 packages in 4.729s

Based on the log you’ve posted, specifically these two lines, it looks like it worked.


#7

I thought so initially but the package did not install completely, on the host computer there is no “saveError” and the package features are usable but they are not usable on the vm install that outputs this error.

I am pretty confident this is a problem with nodejs. Even though the package indicates its installed running this again will produce the same output not an expected output that the package is already installed.

Finally the platformio-ide menus seem present in Atom (when the error occurs) but selecting them does nothing.

Tom


#8

Well, I am definitely not equipped to troubleshoot this given that it’s platformio-ide and I don’t know anything about what it installs behind the scenes, but it does rely on external software because it needs to be able to compile the code you want on your embedded board. It’s possible that this external software isn’t getting properly installed on the VM, which is not something I know how to test for.

I would suggest asking the experts at the PlatformIO Community site, but there’s a chance that the specific software combination you’re trying to pull off hasn’t been done before and that you will have to learn about deeper functions of each component in order to make them work together.