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

Error: Cannot find module 'self-published' #6726

Closed
masx200 opened this issue Aug 15, 2021 · 10 comments
Closed

Error: Cannot find module 'self-published' #6726

masx200 opened this issue Aug 15, 2021 · 10 comments

Comments

@masx200
Copy link

masx200 commented Aug 15, 2021

🐛 bug report

Error: Cannot find module 'self-published'

🎛 Configuration (.babelrc, package.json, cli command)

{
    "devDependencies": {
        "parcel": "2.0.0-nightly.799"
    },
    "name": "jsfuck-and-hieroglyphy-decoder-and-encoder",
    "version": "1.0.0",
    "main": "index.js",
    "repository": {
        "type": "git",
        "url": "git+https://github.com/masx200/JSfuck-and-hieroglyphy-Decoder-and-ENCODER.git"
    },
    "author": "masx200 <[email protected]>",
    "license": "MIT",
    "description": "JSfuck and hieroglyphy Decoder and  ENCODER",
    "bugs": {
        "url": "https://github.com/masx200/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/issues"
    },
    "homepage": "https://github.com/masx200/JSfuck-and-hieroglyphy-Decoder-and-ENCODER#readme",
    "scripts": {
        "build": "parcel build ./src/*.html",
        "start": "parcel serve ./src/*.html",
        "format": "npx prettier --write *.md *.json */*.js */*.html */*.css"
    },
    "keywords": [],
    "dependencies": {
        "prettier": "^2.3.2"
    }
}

🤔 Expected Behavior

😯 Current Behavior

npx parcel serve src/index.html

Error: Cannot find module 'self-published'
Require stack:
- /data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/@parcel/fs-search/index.js
- /data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/@parcel/fs/lib/NodeFS.js
- /data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/@parcel/fs/lib/index.js
- /data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/parcel/lib/cli.js
- /data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/parcel/lib/bin.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (/data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/@parcel/fs-search/index.js:21:20)
    at Module._compile (/data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/@parcel/fs-search/index.js',
    '/data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/@parcel/fs/lib/NodeFS.js',
    '/data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/@parcel/fs/lib/index.js',
    '/data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/parcel/lib/cli.js',
    '/data/data/com.termux/files/home/JSfuck-and-hieroglyphy-Decoder-and-ENCODER/node_modules/parcel/lib/bin.js'
  ]
}

💁 Possible Solution

🔦 Context

💻 Code Sample

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>My First Parcel App</title>
    </head>
    <body>
        <h1>Hello, World!</h1>
    </body>
</html>

🌍 Your Environment

Software Version(s)
Parcel "2.0.0-nightly.799"
Node v14.15.4
npm/Yarn yarn 1.22.11
Operating System Linux localhost 4.19.113-perf-gc78e85e43d72 #1 SMP PREEMPT Fri Aug 6 01:12:47 CST 2021 aarch64 Android
@masx200
Copy link
Author

masx200 commented Aug 15, 2021

It seems to be the error caused by it not supporting android.

@aregaieg0406
Copy link

Hello
I am getting exactly the same error while running "parcel serve src/index.html --open". The used OS is windows 10.
I am using "[email protected]"
Did you get any updates on this issue please ?
Many thanks!

@isaacadams
Copy link
Contributor

isaacadams commented Sep 13, 2021

My coworker was having this issue on his machine while I was not.

We discovered that node's process.arch was returning ia32 on his machine while mine was returning x64.

This is important because that top file where the error is thrown fs-search/index.js relies on process.arch to be x64 if you are running windows x64.

We resolved the issue by uninstalling node and then reinstalling the x64 version.

(for some dialogue about running a x32 node version on a x64 bit machine :: nodejs/node-v0.x-archive#2862)

@JaredSartin
Copy link

JaredSartin commented Sep 13, 2021

Getting this today, have not changed node versions. My OS is x64 Win10 and process.arch is returning x64

EDIT:
Deleted package lock and node modules, ended up reinstalling my modules twice and it "just worked" (tm) - could be a larger factor of plugins in parcel and all node_modules in the project

@cxreiff
Copy link

cxreiff commented Sep 22, 2021

I am getting this same issue while building my project in Play.js (an iOS javascript IDE). This project built fine prior to upgrading to Parcel 2. I understand that my use case is fairly niche, but it seems like there is some unintended behavior here given that the package required that is causing the error (self-published) is listed as a devDependency and not a runtime dependency in the fs-search package.json. It could be that I just don't understand that "self-published": "npm:@parcel/[email protected]" construction in the dependencies.

parcel/packages/utils/fs-search/package.json:

"dependencies": {
"detect-libc": "^1.0.3"
},
"devDependencies": {
"@napi-rs/cli": "1.0.4",
"self-published": "npm:@parcel/[email protected]"
},

@michaud
Copy link

michaud commented Sep 25, 2021

hitting the same issue on windows 10 with the minimal setup from the 'get started' docs, I updated to the latest node 14.17.6 LTS (I had a lower minor version 14.17.x), deleted node_modules and package-lock.json, did npm install and it "just worked" (tm)

@mischnic
Copy link
Member

Is this still a problem?

@JaredSartin
Copy link

I got around it by full-cleaning/install: delete yarn/npm caches (I even cleaned global). After the next install, I was ok.

@cxreiff
Copy link

cxreiff commented Nov 17, 2021

As of 2.0.0, when running in Play.js on iOS this issue has been replaced with the error "Cannot find module './artifacts/index.ios-arm64.node'" which appears to be an expected lack of support for the environment as opposed to a bug (I've since stopped using Play.js in favor of a digitalocean instance and ssh).

@mischnic
Copy link
Member

I think the docs of that app also say that loading native modules is generally disallowed by iOS, so wouldn't work even if there were a corresponding prebuilt binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants