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

Run Azure Digital Twins Explorer locally: npm run start getting failed with 'ERR_PACKAGE_PATH_NOT_EXPORTED'. #233

Open
karthikkc24 opened this issue Nov 18, 2021 · 14 comments

Comments

@karthikkc24
Copy link

Step-5 Getting Started -> Running digital-twins-explorer locally, npm run start getting failed due to 'ERR_PACKAGE_PATH_NOT_EXPORTED'. After following the steps unable to see the browser opened with the app.

Please find the below screenshot for your reference:
image

@csyvenkyteck
Copy link

The exact same error happens for the Docker version. The docker build command executes without fail. The docker run stops with exception.

@guydillen
Copy link

same error here with the Docker version

@ccrowley96
Copy link
Contributor

Did you run npm install before start?

This may be an issue with spaces being present in the project path - /Hands-on lab/

From the README:

IMPORTANT! Due to a dependency on the npm-force-resolutions package to mitigate an underlying security issue you will not be able to install under any path that contains a space. For more information, see this GitHub issue

@guydillen
Copy link

guydillen commented Dec 2, 2021

I'm trying to run Azure Digital Twins Explorer with Docker.

[email protected] start
react-scripts start

node:internal/modules/cjs/loader:488
throw e;
^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /usr/src/app/client/node_modules/postcss-safe-parser/node_modules/postcss/package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
at packageExportsResolve (node:internal/modules/esm/resolve:683:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/usr/src/app/client/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v17.2.0

@DawnmarieDesJardins
Copy link

Hello! Any update on this issue? We have a Microsoft Cloud Workshops lab that uses this. Thank you!! :)

@terrymandin
Copy link

I encountered the ERR_PACKAGE_PATH_NOT_EXPORTED issue when running the docker version.

When I ran on my PC I got a 'FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory' error.

@ThinLizzy13
Copy link

Same for me: Docker on Mac Anyone any luck?

@terrymandin
Copy link

I recommend installing from one of the releases. I was able to get the ADT Explorer running in standalone that way. I didn't try the docker deployment.

@ThinLizzy13
Copy link

Unfortunately still not working for me.

I recommend installing from one of the releases. I was able to get the ADT Explorer running in standalone that way. I didn't try the docker deployment.

Was there a release in particular you had any luck with? Cheers

@terrymandin
Copy link

I downloaded the top zip file #235622. Note that I did not try to create the docker container. Instead I ran the node file on my PC.

@ccrowley96
Copy link
Contributor

ccrowley96 commented Dec 10, 2021

@terrymandin If the build is failing with a heap out of memory error, can you try to update the build script in the package.json to the snippet below and try running / building again?

"build": "react-scripts --max_old_space_size=4096 build"

If the start script is failing, you can update the start script to:

"start": "react-scripts --max_old_space_size=4096 start"

I encountered the ERR_PACKAGE_PATH_NOT_EXPORTED issue when running the docker version.

When I ran on my PC I got a 'FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory' error.

@ccrowley96
Copy link
Contributor

Another thing to try is to delete the node_modules folder and run npm install again before starting / building the app.

@ThinLizzy13
Copy link

Thanks @ccrowley96 and @terrymandin. Just in case anyone else reading this and getting similar issues for Docker

I think the main issue is Node v17. I went back and installed v16 and it seems to work. (On my terminal with node -v it’s working with v16.13.1 )

Steps that I did to fix. Following the Docker instructions for digital-twins-explorer

  1. Git clone as per usual git clone https://github.com/Azure-Samples/digital-twins-explorer.git

  2. Edit the Dockerfile

Change the lines

FROM node:current-slim

To

FROM node:16

And I commented out the update lines below so it reads:

# Install required dependencies
# RUN apt-get update
# RUN apt-get -y install curl python make g++
  1. Then build as per: docker build -t azure-digital-twins-explorer .

  2. With the instruction docker run -it -p3000:3000 azure-digital-twins-explorer I ran into the same issues as Terry above: @ccrowley96 ’s steps worked perfectly.

  3. Running ok now at localhost:3000 on Google Chrome.

cicorias added a commit to cicorias/digital-twins-explorer that referenced this issue Mar 31, 2022
this pins node to the LTS-slim
so it will at least work
and get updates

address Azure-Samples#233
@UlisesGascon
Copy link

I had the same issue: It is not working with Node.js v17, but is working fine with Node.js v14

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

8 participants