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

Can't build on Ubuntu 18.10 : Cannot read property 'toString' of null #676

Closed
NatoBoram opened this issue Nov 1, 2018 · 3 comments · Fixed by #709
Closed

Can't build on Ubuntu 18.10 : Cannot read property 'toString' of null #676

NatoBoram opened this issue Nov 1, 2018 · 3 comments · Fixed by #709

Comments

@NatoBoram
Copy link

NatoBoram commented Nov 1, 2018

Hello! I tried to build it and it failed.

I ran exactly these commands :

git clone https://github.com/ipfs-shipyard/ipfs-desktop.git
cd ipfs-desktop
npm install
npm start

Here's the errors :

npm WARN [email protected] requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint@^4.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN You are using a pre-release version of node and things may not work as expected
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/macos-alias):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/appdmg):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 35176 packages in 13.15s
found 13 vulnerabilities (6 low, 6 moderate, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details
> [email protected] start /home/nato/Documents/GitHub/ipfs-desktop
> electron-forge start

✖ Checking your system

An unhandled error has occurred inside Forge:
Cannot read property 'toString' of null
TypeError: Cannot read property 'toString' of null
    at warnIfPackageManagerIsntAKnownGoodVersion (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/electron-forge/dist/util/check-system.js:98:33)
    at /home/nato/Documents/GitHub/ipfs-desktop/node_modules/electron-forge/dist/util/check-system.js:44:9
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `electron-forge start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start 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/nato/.npm/_logs/2018-11-01T02_40_15_938Z-debug.log

System info :

OS: Ubuntu 18.10 x86_64 
Kernel: 4.18.0-10-generic 
Uptime: 4 hours, 19 mins 
Packages: 2076 (dpkg), 41 (snap) 
Shell: bash 4.4.19 
Resolution: 1920x1080 
DE: GNOME 3.30.1 
WM: GNOME Shell 
WM Theme: Adwaita 
Theme: Adwaita-dark [GTK2/3] 
Icons: Yaru [GTK2/3] 
Terminal: gnome-terminal 
CPU: Intel i5-3570K (4) @ 4.100GHz 
GPU: NVIDIA GeForce GTX 660 Ti 
Memory: 4721MiB / 7921MiB

NPM :

{
	"npm": "6.4.1",
	"ares": "1.14.0",
	"cldr": "34.0",
	"http_parser": "2.8.0",
	"icu": "63.1",
	"modules": "67",
	"napi": "3",
	"nghttp2": "1.34.0",
	"node": "12.0.0-nightly20181031d690a87b8c",
	"openssl": "1.1.0i",
	"tz": "2018e",
	"unicode": "11.0",
	"uv": "1.23.2",
	"v8": "7.0.276.32-node.7",
	"zlib": "1.2.11"
}
@NatoBoram
Copy link
Author

One thing I hate about NodeJS is how inconsistent it is. I just tried to build the new branch, and it works. Then, I updated NPM, and I can't build it anymore. I uninstalled NodeJS and reinstalled it and I'll try to reproduce the steps and write more reports. There's definitely something fishy about the dependencies.

@NatoBoram
Copy link
Author

NatoBoram commented Nov 3, 2018

Okay, here's what happens.

In order to be able to build the application, I need first to npm i on the master branch. Then, I need to switch to new and npm i again. There I'll be able to npm start. But there's plenty of errors and it doesn't look like what I expected the app to look like.

Also, before I get "You're using a preview of Node.js!", know that it does the exact same thing in both Node.js 11 and Node.js 12. I haven't tested legacy versions, however.

npm i; npm start;
npm WARN npm npm does not support Node.js v12.0.0-nightly20181031d690a87b8c
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I'll try to do my best with it!
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/1242/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] postinstall /home/nato/Documents/GitHub/ipfs-desktop/node_modules/electron
> node install.js


> [email protected] postinstall /home/nato/Documents/GitHub/ipfs-desktop
> electron-builder install-app-deps

  • electron-builder version=20.28.4
  • loaded configuration file=package.json ("build" field)
  • rebuilding native production dependencies platform=linux arch=x64
Error: /snap/node/1242/bin/node exited with code 7
Output:

> [email protected] install /home/nato/Documents/GitHub/ipfs-desktop/node_modules/secp256k1
> npm run rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used."


> [email protected] install /home/nato/Documents/GitHub/ipfs-desktop/node_modules/leveldown
> prebuild-install || node-gyp rebuild


Error output:
npm WARN npm npm does not support Node.js v12.0.0-nightly20181031d690a87b8c
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/1242/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 7
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/nato/.npm/_logs/2018-11-03T04_15_29_385Z-debug.log

    at ChildProcess.childProcess.once.code (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/builder-util/src/util.ts:254:14)
    at Object.onceWrapper (events.js:273:13)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:969:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:257:5)
From previous event:
    at rebuild (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/app-builder-lib/out/util/yarn.js:239:18)
    at /home/nato/Documents/GitHub/ipfs-desktop/node_modules/app-builder-lib/src/util/yarn.ts:20:11
From previous event:
    at installOrRebuild (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/app-builder-lib/out/util/yarn.js:68:17)
    at /home/nato/Documents/GitHub/ipfs-desktop/node_modules/electron-builder/src/cli/install-app-deps.ts:56:9
    at Generator.next (<anonymous>)
From previous event:
    at installAppDeps (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/electron-builder/out/cli/install-app-deps.js:174:17)
    at then (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/electron-builder/src/cli/cli.ts:42:48)
    at processImmediate (timers.js:632:19)
From previous event:
    at Object.args [as handler] (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/electron-builder/src/cli/cli.ts:42:48)
    at Object.runCommand (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/yargs/lib/command.js:238:44)
    at Object.parseArgs [as _parseArgs] (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/yargs/yargs.js:1059:30)
    at Object.get [as argv] (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/yargs/yargs.js:1000:21)
    at Object.<anonymous> (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/electron-builder/src/cli/cli.ts:25:28)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:760:12)
    at startup (internal/bootstrap/node.js:308:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `electron-builder install-app-deps`
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!     /home/nato/.npm/_logs/2018-11-03T04_15_29_449Z-debug.log
npm WARN npm npm does not support Node.js v12.0.0-nightly20181031d690a87b8c
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/1242/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] start /home/nato/Documents/GitHub/ipfs-desktop
> cross-env NODE_ENV=development electron -r @babel/register src/index.js

2018-11-03T04:15:31.504Z info: Logger set up. Logs can be found on /home/nato/.config/Electron
2018-11-03T04:15:32.547Z info: Menubar is ready
2018-11-03T04:15:32.550Z info: Hash download shortcut enabled
2018-11-03T04:15:32.552Z info: Screenshot shortcut enabled
2018-11-03T04:15:32.565Z info: Launch on startup enabled

(electron:13684): libappindicator-WARNING **: 00:15:32.668: Using '/tmp' paths in SNAP environment will lead to unreadable resources
2018-11-03T04:15:37.622Z info: Disconnecting all IPFS instances
2018-11-03T04:15:37.623Z info: Done. Quitting app

It's worth noting that I already I have my own node up and running, and I'm currently downloading 5 GB of files at an atrociously slow speed. It looks like the app doesn't support being connected to another node than its own because the icon is greyed out, but it might also be just because the app doesn't do anything since all the windows it opens are empty.

image

Switching back to master then trying npm i; npm start doesn't make the master branch work either.

Switching from NodeJS 11 to 12 fixed npm's update being unable to build the app. Now I can update npm and still build IPFS Desktop. However, like in the screenshot above, it does absolutely nothing and there's all these errors I've already pasted.

I really wish I was able to use IPFS Desktop.

This was referenced Nov 3, 2018
@NatoBoram NatoBoram changed the title Cannot read property 'toString' of null Can't build on Ubuntu 18.10 : Cannot read property 'toString' of null Nov 5, 2018
@NatoBoram
Copy link
Author

After following the additional information found in #681 (comment), I tried to build it again on Ubuntu. The result is different. The problem now seems to be API.HTTPHeaders key has no attributes.

> [email protected] start /home/nato/Documents/GitHub/ipfs-desktop
> cross-env NODE_ENV=development electron -r @babel/register src/index.js

superagent: Enable experimental feature http2
2018-11-14T23:09:19.349Z info: Logger set up. Logs can be found on /home/nato/.config/Electron
(node:30774) ExperimentalWarning: The http2 module is an experimental API.
2018-11-14T23:09:19.565Z info: Cleaning repo.lock and api files
(node:30774) UnhandledPromiseRejectionWarning: Error: failed to get config value: "API.HTTPHeaders key has no attributes"
    at parseError (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/ipfs-api/src/utils/send-request.js:17:17)
    at ClientRequest.<anonymous> (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/ipfs-api/src/utils/send-request.js:47:14)
    at Object.onceWrapper (events.js:273:13)
    at ClientRequest.emit (events.js:182:13)
    at HTTPParser.parserOnIncomingClient (_http_client.js:546:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
    at Socket.socketOnData (_http_client.js:432:20)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:279:12)
    at readableAddChunk (_stream_readable.js:264:11)
(node:30774) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:30774) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

It is also worth noting that the program will crash if there's an active node on the system. Might want to check that.

> [email protected] start /home/nato/Documents/GitHub/ipfs-desktop
> cross-env NODE_ENV=development electron -r @babel/register src/index.js

superagent: Enable experimental feature http2
2018-11-14T23:13:01.941Z info: Logger set up. Logs can be found on /home/nato/.config/Electron
(node:30972) ExperimentalWarning: The http2 module is an experimental API.
2018-11-14T23:13:02.143Z info: Cleaning repo.lock and api files
(node:30972) UnhandledPromiseRejectionWarning: Error: Command failed: /home/nato/Documents/GitHub/ipfs-desktop/node_modules/go-ipfs-dep/go-ipfs/ipfs daemon
Error: resource temporarily unavailable

Initializing daemon...
go-ipfs version: 0.4.18-
Repo version: 7
System version: amd64/linux
Golang version: go1.11.1

    at makeError (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/ipfsd-ctl/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/home/nato/Documents/GitHub/ipfs-desktop/node_modules/ipfsd-ctl/node_modules/execa/index.js:278:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:30972) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:30972) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

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

Successfully merging a pull request may close this issue.

1 participant