Appflow with cordova detects capacitor instead in build - node.js

I have a project that used to use capacitor but now uses only cordova.
Upon versioning it to a Commit in my Ionic Dashboard, I attempted to create a Build from this Commit and received this error
[13:57:35]: --------------------------------
[13:57:35]: --- Step: detect_native_type ---
[13:57:35]: --------------------------------
[13:57:35]: Checking if cordova or capacitor project
[13:57:35]: Capacitor project with TS/JS config detected
[13:57:35]: --------------------------------
[13:57:35]: --- Step: dependency_install ---
[13:57:35]: --------------------------------
[13:57:35]: Installing Dependencies
[13:57:35]: $ npm ci --quiet --no-optional
[13:58:03]: ▸ > core-js#3.17.3 postinstall /builds/project-0/node_modules/core-js
[13:58:03]: ▸ > node -e "try{require('./postinstall')}catch(e){}"
[13:58:04]: ▸ > core-js#3.6.4 postinstall /builds/project-0/node_modules/#angular-devkit/build-angular/node_modules/core-js
[13:58:04]: ▸ > node -e "try{require('./postinstall')}catch(e){}"
[13:58:04]: ▸ > sharp#0.25.4 install /builds/project-0/node_modules/sharp
[13:58:04]: ▸ > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
[13:58:04]: ▸ info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
[13:58:06]: ▸ > #angular/cli#9.1.15 postinstall /builds/project-0/node_modules/#angular/cli
[13:58:06]: ▸ > node ./bin/postinstall/script.js
[13:58:07]: ▸ added 2108 packages in 31.198s
[13:58:07]: -------------------------------------
[13:58:07]: --- Step: create_capacitor_config ---
[13:58:07]: -------------------------------------
[13:58:09]: -------------------------
[13:58:09]: --- Step: upload_logs ---
[13:58:09]: -------------------------
[13:58:17]: Unable to upload npm package list log. Skipping.
+------------------+-----------------------+
| Lane Context |
+------------------+-----------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | android |
| LANE_NAME | android package_build |
+------------------+-----------------------+
[13:58:20]: Capacitor config command failed, ensure capacitor dependency has been updated to version 3 or more
+------+-------------------------+-------------+
| fastlane summary |
+------+-------------------------+-------------+
| Step | Action | Time (in s) |
+------+-------------------------+-------------+
| 1 | default_platform | 0 |
| 2 | build_summary | 0 |
| 3 | add_git_credentials | 0 |
| 4 | get_appflow_config | 0 |
| 5 | detect_native_type | 0 |
| 6 | dependency_install | 31 |
| 💥 | create_capacitor_config | 2 |
| 8 | upload_logs | 11 |
+------+-------------------------+-------------+
[13:58:20]: fastlane finished with errors
/usr/local/bundle/bin/fastlane: [!] Capacitor config command failed, ensure capacitor dependency has been updated to version 3 or more (RuntimeError)
/usr/local/bundle/gems/fastlane-2.179.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': Shell command exited with exit status 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/helper/sh_helper.rb:12:in `sh'
from /builds/project-0/fastlane/actions/create_capacitor_config.rb:13:in `run'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
from Fastfile:162:in `block (2 levels) in parsing_binding'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/lane.rb:33:in `call'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/commands_generator.rb:352:in `run'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
from /usr/local/bundle/gems/fastlane-2.179.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'
from /usr/local/bundle/gems/fastlane-2.179.0/bin/fastlane:23:in `<top (required)>'
from /usr/local/bundle/bin/fastlane:23:in `load'
from /usr/local/bundle/bin/fastlane:23:in `<main>'
What makes this error so odd is that every mention of 'capacitor' has been removed from my project including the capacitor.config.json file.
My ionic.config.json setup looks like this
"integrations": {
"cordova": {}
},
On top of that, I removed the package-lock.json and /node_modules and reinstalled, and then I ionic cordova platform add/remove ios & android and then 1ionic cordova prepare` ios & android.
Still, I receive this error.
Could anyone help me remove capacitor from my Build process in ionic dashboard

This is a known issue from Ionic and the solution is to contact Ionic and have them properly switch the account to capacitor or cordova. Solution 2 is that you need to create a new project on ionic with cordova or capacitor and then clone your project to it.

Related

Playwright tests are not running on gitlab CICD

Hello,
While my Playwright tests are running perfectly on my local machine, on a remote gitlab machine they all fail.
The output looks like this:
$ cd playwright
$ npm ci
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
> cd .. && husky install front/.husky
husky - Git hooks installed
added 236 packages, and audited 237 packages in 25s
70 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ npx playwright install
Downloading Chromium 105.0.5195.19 (playwright build v1019)...
| | 0% of 133.2 Mb
|■■■■■■■■ | 10% of 133.2 Mb
|■■■■■■■■■■■■■■■■ | 20% of 133.2 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■ | 30% of 133.2 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 40% of 133.2 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 50% of 133.2 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 60% of 133.2 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 70% of 133.2 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 80% of 133.2 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 90% of 133.2 Mb
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 133.2 Mb
Chromium 105.0.5195.19 (playwright build v1019) downloaded to /ms-playwright/chromium-1019
$ npm run ci:test
npx playwright test --config=src/configs/playwright.prod.config.ts
Running 30 tests using 10 workers
and then a bunch of red tests names lines indicating failure:
✘ 2 [chromium] › account-settings.test.ts:12:3 › Account Settings functionality › validate account timezone modification (50s)
✘ 3 [chromium] › account-settings.test.ts:16:3 › Account Settings functionality › validate adding api key (50s)
page.goto: Timeout 50000ms exceeded.
7 | test.describe('Account Settings functionality', () => {
8 | test('validate account phone number modification', async ({ page }) => {
> 9 | await validateChangePhoneNumber({ page });
| ^
10 | });
...
29 failed
at Object.Account Settings (/builds/dashboard-client/playwright/src/support/navigate/navigateToPage.ts:91:28)
at navigationByPageName (/builds/dashboard-client/playwright/src/support/navigate/navigateToPage.ts:102:10)
at validateChangeTimezone (/builds/dashboard-client/playwright/src/support/validate/validateAccountSettings/validateChangeTimezome.ts:12:9)
at /builds/dashboard-client/playwright/src/tests/account-settings.test.ts:13:11
By looking at the recording it seems that the app is opened but no navigation step occurres until timeout exceeds.
The dependencies for Playwright are missing as indicated by the 'Downloading Chromium' progress indicators.
According to the documentation npx playwright install --with-deps will install the deps. Refer to: https://playwright.dev/docs/ci.

How to using docker-compose with environment

I have node application that build into an image. This image not contain .env file because I add it on .gitignore whereas the application need it. How can I configure this environment on docker-compose?
I've read some of example but still dont get it. This question has same problem with me but it still doesn't work.
docker-compose:
version: "3.7"
services:
node:
container_name: node-app
image: node_app:latest
ports:
- 3334:3333
environment:
- HOST=127.0.0.1
- PORT=3333
- NODE_ENV=dummy
- APP_NAME=AdonisJs
- CACHE_VIEWS=false
- DB_CONNECTION=mysql
- DB_HOST=127.0.0.1
- DB_PORT=3306
- DB_USER=root
- DB_PASSWORD=password
- DB_DATABASE=database
Dockerfile:
FROM node:14
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm i -g #adonisjs/cli
RUN npm install
ENV HOST=0.0.0.0
COPY . .
EXPOSE 3333
CMD [ "node", "server.js" ]
Everytime I run docker-compose up its ended up with this.
WARNING: The HOST variable is not set. Defaulting to a blank string.
WARNING: The PORT variable is not set. Defaulting to a blank string.
Recreating node-app_node_1 ... done
Attaching to node-app_node_1
node_1 |
node_1 | Error: ENOENT: no such file or directory, open '/usr/src/app/.env'
node_1 |
node_1 |
node_1 | 1 Env.load
node_1 | /usr/src/app/node_modules/#adonisjs/framework/src/Env/index.js:110
node_1 |
node_1 | 2 new Env
node_1 | /usr/src/app/node_modules/#adonisjs/framework/src/Env/index.js:42
node_1 |
node_1 | 3 Object.closure
node_1 | /usr/src/app/node_modules/#adonisjs/framework/providers/AppProvider.js:29
node_1 |
node_1 | 4 Ioc._resolveBinding
node_1 | /usr/src/app/node_modules/#adonisjs/fold/src/Ioc/index.js:231
node_1 |
node_1 | 5 Ioc.use
node_1 | /usr/src/app/node_modules/#adonisjs/fold/src/Ioc/index.js:731
node_1 |
node_1 | 6 AppProvider.boot
node_1 | /usr/src/app/node_modules/#adonisjs/framework/providers/AppProvider.js:337
node_1 |
node_1 | 7 anonymous
node_1 | /usr/src/app/node_modules/#adonisjs/fold/src/Registrar/index.js:147
node_1 |
node_1 | 8 arrayMap
node_1 | /usr/src/app/node_modules/lodash/lodash.js:653
node_1 |
node-app_node_1 exited with code 1
All I know that docker-compose environment pass to the variable that called just as same as we define to get the value, but there is not .env file on the image to called the variable. What I have to do to make the docker-compose can pass the environment to the app? Any suggestion will be appreciated.
ENOENT indicates that node is looking for a file at /usr/src/app/.env but there is nothing there. Try adding
RUN touch /usr/src/app/.env
to your Dockerfile and see if having an empty .env file fixes it.

Git is committing node_modules despite being ignored [duplicate]

This question already has answers here:
Make the current commit the only (initial) commit in a Git repository?
(17 answers)
Closed 2 years ago.
One of the dependencies in my project uses chromium (which is over 100mb) and makes github throw an error when trying to push it.
To solve this, I made sure to ignore my node_modules folder.
However I still get the error when I try to push.
Here is my .gitignore file:
.env
node_modules
node_modules/*
Here's the output of git ls-tree -r master --name-only:
.DS_Store
.gitignore
README.md
app.js
package-lock.json
package.json
public/index.html
public/sign-in-with-twitter.png
public/styles.css
server.js
utils/.DS_Store
utils/database.js
utils/encryption.js
utils/gradients.js
utils/increments.js
utils/twitter.js
And here's the full error when trying to push:
remote: D, [2020-09-16T12:48:02.974268 #49478] DEBUG -- : FAILBOT EXCEPTION: action=processing exception=NoMethodError original_type: GitHub::PreReceiveBlob::PushRejected data={"release"=>"6507d92df20b3ea50e34effb905bb46f3d94cc3d", "current_ref"=>"train-b4ab8774", "app"=>"github-user", "ruby"=>"ruby 2.7.1p92 (2020-07-11 revision 4ec8c70524) [x86_64-linux]", "server"=>"github-dfs-08e6617.va3-iad.github.net", "deployed_to"=>"production", "kube_namespace"=>"unknown", "pusher"=>"gb221", "proto"=>"ssh", "path"=>"/data/repositories/7/nw/79/2e/61/297891227/295655929.git", "from"=>"hooks/pre-receive.rb.rb [gb221/gradient-twitter.git]", "audit_msg"=>"{ \"above_lock_quota\":false, \"above_warn_quota\":false, \"babeld\":\"61941ce7\", \"babeld_proto\":\"ssh\", \"check_lfs_integrity\":false, \"cmdline\":\"/usr/lib/git-core/git receive-pack .\", \"committer_date\":\"1600285604 -0700\", \"disable_hooks\":true, \"features\":\" report-status side-band-64k agent=git/2.22.0\", \"frontend\":\"unicorn-gitauth-api-654b85c97f-s5c4m\", \"frontend_pid\":133, \"frontend_ppid\":6, \"git_dir\":\"/data/repositories/7/nw/79/2e/61/297891227/295655929.git\", \"git_dir_safe\":\"/data/repositories/7/nw/79/2e/61/297891227/295655929.git\", \"gitauth_version\":\"6507d92d\", \"hostname\":\"github-dfs-08e6617.va3-iad.github.net\", \"pgroup\":\"64872\", \"pid\":64872, \"ppid\":64848, \"program\":\"receive-pack\", \"proxy_pre_fetch_and_detect_have_present\":false, \"pubkey_creator_id\":18144602, \"pubkey_creator_login\":\"gb221\", \"pubkey_fingerprint\":\"75:cb:2d:06:a1:8a:34:db:b7:cf:27:8d:2d:f8:15:90\", \"pubkey_id\":46204985, \"pubkey_verifier_id\":18144602, \"pubkey_verifier_login\":\"gb221\", \"quotas_enabled\":true, \"real_ip\":\"86.146.63.195\", \"received_objects\":2909, \"remote_addr\":\"10.56.111.46\", \"remote_port\":\"54238\", \"repo_config\":\"{\\\"allow_auto_deleting_branches\\\":\\\"false\\\",\\\"dependency_vulnerability_alerts.disabled\\\":\\\"true\\\",\\\"repository_dependency_updates.vulnerabilities.disabled\\\":\\\"true\\\",\\\"tiered_reporting\\\":\\\"false\\\"}\", \"repo_id\":295655929, \"repo_name\":\"gb221/gradient-twitter\", \"repo_public\":false, \"request_id\":\"fccb4e4a60b223744cc60e177b626e75\", \"status\":\"pre_receive_hook\", \"use_http_postrx\":true, \"user_id\":18144602, \"user_login\":\"gb221\", \"user_operator_mode\":false }", "env"=>"production", "error_code"=>"45a2d52ef1b728ec2c1124abf968e3d6", "exception_detail"=>[{"type"=>"GitHub::PreReceiveBlob::PushRejected", "value"=>"GitHub::PreReceiveBlob::PushRejected", "stacktrace"=>[]}], "created_at"=>"2020-09-16T19:48:02.973358Z", "refs"=>"refs/heads/master: 0dbd850362f939fe02d2e656912a42fdebb32eff", "files"=>"node_modules/svg-to-img/node_modules/puppeteer/.local-chromium/mac-536395/chrome-mac/Chromium.app/Contents/Versions/66.0.3347.0/Chromium Framework.framework/Versions/A/Chromium Framework: 125274684 bytes", "repo_id"=>295655929, "rollup"=>"2a7bc1e29623942867c40e965f833e13"}
remote: D, [2020-09-16T12:48:02.974312 #49478] DEBUG -- : GitHub::PreReceiveBlob::PushRejected
remote: D, [2020-09-16T12:48:02.975337 #49478] DEBUG -- : undefined method `hour' for 1:Integer
remote: D, [2020-09-16T12:48:02.975391 #49478] DEBUG -- : /data/github/releases/20200916185747-6507d92df20b3ea50e34effb905bb46f3d94cc3d/lib/github/config/failbot.rb:86:in `block in <top (required)>'
remote: /data/github/releases/20200916185747-6507d92df20b3ea50e34effb905bb46f3d94cc3d/vendor/gems/2.7.1/ruby/2.7.0/gems/failbot-2.5.5/lib/failbot.rb:345:in `report!'
remote: /data/github/releases/20200916185747-6507d92df20b3ea50e34effb905bb46f3d94cc3d/vendor/gems/2.7.1/ruby/2.7.0/gems/failbot-2.5.5/lib/failbot.rb:322:in `report'
remote: /data/github/releases/20200916185747-6507d92df20b3ea50e34effb905bb46f3d94cc3d/lib/github/githooks/pre_receive_blob.rb:75:in `check'
remote: /data/github/releases/20200916185747-6507d92df20b3ea50e34effb905bb46f3d94cc3d/lib/github/githooks/push_context.rb:40:in `block (2 levels) in check'
remote: /data/github/releases/20200916185747-6507d92df20b3ea50e34effb905bb46f3d94cc3d/vendor/gems/2.7.1/ruby/2.7.0/gems/dogstatsd-ruby-4.1.0/lib/datadog/statsd.rb:356:in `time'
remote: /data/github/releases/20200916185747-6507d92df20b3ea50e34effb905bb46f3d94cc3d/lib/github/githooks/push_context.rb:39:in `block in check'
remote: /data/github/releases/20200916185747-6507d92df20b3ea50e34effb905bb46f3d94cc3d/lib/github/githooks/push_context.rb:34:in `each'
remote: /data/github/releases/20200916185747-6507d92df20b3ea50e34effb905bb46f3d94cc3d/lib/github/githooks/push_context.rb:34:in `check'
remote: hooks/pre-receive.rb:52:in `block in <main>'
remote: /data/github/releases/20200916185747-6507d92df20b3ea50e34effb905bb46f3d94cc3d/vendor/gems/2.7.1/ruby/2.7.0/gems/dogstatsd-ruby-4.1.0/lib/datadog/statsd.rb:356:in `time'
remote: hooks/pre-receive.rb:51:in `<main>'
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 45a2d52ef1b728ec2c1124abf968e3d6
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File node_modules/svg-to-img/node_modules/puppeteer/.local-chromium/mac-536395/chrome-mac/Chromium.app/Contents/Versions/66.0.3347.0/Chromium Framework.framework/Versions/A/Chromium Framework is 119.47 MB; this exceeds GitHub's file size limit of 100.00 MB
To github.com:gb221/gradient-twitter.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#github.com:gb221/gradient-twitter.git'
I've tried clearing all tracked files and re-adding everything (as described here) but that doesn't work.
I ended up solving it by removing all historic commits.
For those also in the same position I followed this.

Node App Error--Failed ro replace env in config: ${NPM_TOKEN}

I am trying to build a Docker image for my Sails.js application. Here's the Dockerfile:
FROM risingstack/alpine:3.4-v8.5.0-4.7.0
ENV NODE_ENV test
RUN npm install -g sails
COPY npmrc_file .npmrc
ARG NPM_TOKEN
COPY package.json package.json
RUN npm install
RUN rm -f .npmrc
# Add your source files
COPY . .
EXPOSE 3000
CMD ["npm","start"]
I took the steps for this Dockerfile from this link on the NPM documentation site. I have made sure to match what the documentation there shows perfectly.
My docker build command is:
image="my-repo-url/tagname:tagversion"
docker build --build-arg NPM_TOKEN=my-token-goes-here -t $image -f Dockerfile .
Then I run the container with the image using docker stack or docker-compose. The container doesn't start up, due to the following error:
sails_1 | Error: Failed to replace env in config: ${NPM_TOKEN}
sails_1 | at /usr/lib/node_modules/npm/lib/config/core.js:418:13
sails_1 | at String.replace (<anonymous>)
sails_1 | at envReplace (/usr/lib/node_modules/npm/lib/config/core.js:414:12)
sails_1 | at parseField (/usr/lib/node_modules/npm/lib/config/core.js:392:7)
sails_1 | at /usr/lib/node_modules/npm/lib/config/core.js:335:17
sails_1 | at Array.forEach (<anonymous>)
sails_1 | at Conf.add (/usr/lib/node_modules/npm/lib/config/core.js:334:23)
sails_1 | at ConfigChain.addString (/usr/lib/node_modules/npm/node_modules/config-chain/index.js:244:8)
sails_1 | at Conf.<anonymous> (/usr/lib/node_modules/npm/lib/config/core.js:322:10)
sails_1 | at /usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16
sails_1 | /usr/lib/node_modules/npm/lib/npm.js:52
sails_1 | throw new Error('npm.load() required')
sails_1 | ^
sails_1 |
sails_1 | Error: npm.load() required
sails_1 | at Object.get (/usr/lib/node_modules/npm/lib/npm.js:52:13)
sails_1 | at process.errorHandler (/usr/lib/node_modules/npm/lib/utils/error-handler.js:213:18)
sails_1 | at emitOne (events.js:115:13)
sails_1 | at process.emit (events.js:210:7)
sails_1 | at process._fatalException (bootstrap_node.js:399:26)
The thing is, by the time we get to running the container, there should be no reference to or need for the ${NPM_TOKEN}. I'm using this exact same setup in another project, and don't see this error, so I'm not really sure what the deal is. I have triple checked that everything is the same in this project as the other project.
What are the possible reasons for this error and some possible solutions?
I've also read through this thread and this SO question. I feel like everything I've read has pointed me to the same solution, which I've implemented, but with no success.
This is what worked for me in the end:
ARG NPM_TOKEN
ENV NPM_TOKEN="${NPM_TOKEN}"
Why this solved this issue, I'm not sure!
This is what I am using,
in Dockerfile
ARG NPM_AUTH_TOKEN=$NPM_AUTH_TOKEN
ENV NPM_AUTH_TOKEN=$NPM_AUTH_TOKEN
and in docker-compose.yml
version: '2'
services:
app:
build:
args:
- NPM_AUTH_TOKEN

Upgrade graceful-fs module to a recent version

i've a docker container from node:6 official image.
I'd like trying this project: https://github.com/mozilla/fxa-webrtc-idp
node version is 6.9.5
npm version is 3.10.10
when i exec npm test, this is what appairs:
root#3be6ee5c1ab6:/fxa-webrtc-idp# npm test
npm info it worked if it ends with ok
npm info using npm#3.10.10
npm info using node#v6.9.5
npm info lifecycle fxa-webrtc-idp#0.64.0~pretest: fxa-webrtc-idp#0.64.0
npm info lifecycle fxa-webrtc-idp#0.64.0~test: fxa-webrtc-idp#0.64.0
> fxa-webrtc-idp#0.64.0 test /fxa-webrtc-idp
> LOG_LEVEL=error grunt test --node-env=test
(node:354) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Running "copyright:app" (copyright) task
Running "eslint:files" (eslint) task
Running "mochaTest:test" (mochaTest) task
the route /sign
✓ returns a 401 when the request is not authenticated
✓ returns a signed assertion when the request is authenticated
the route /
✓ should return version information
the route /__version__
✓ should return version information
4 passing (44ms)
Running "mochaTest:coverage" (mochaTest) task
Coverage Summary:
Name Stmts Miss Cover Missing
-----------------------------------------------------------
lib/app.js 22 0 100%
lib/logging/summary.js 14 3 79% 14,30,31
lib/routes/index.js 1 0 100%
lib/routes/oauthBegin.js 7 2 71% 20,25
lib/routes/oauthComplete.js 8 2 75% 18,24
lib/routes/sign.js 10 0 100%
lib/routes/verify.js 16 9 44% 14,23,26,27,29,31,32,35,37
lib/routes/version.js 52 8 85% 34,35,47,48,60,61,74,75
===========================================================
TOTAL 130 24 82%
Running "mochaTest:travis-cov" (mochaTest) task
Coverage: 81%
Code coverage below threshold: 81 < 95
Execution Time (2017-02-08 11:46:19 UTC)
loading tasks 1s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 58%
eslint:files 432ms ▇▇▇▇▇▇▇▇▇▇▇▇ 25%
mochaTest:test 287ms ▇▇▇▇▇▇▇▇ 16%
Total 1.8s
npm info lifecycle fxa-webrtc-idp#0.64.0~test: Failed to exec test script
npm ERR! Test failed. See above for more details.
When i exec npm ls graceful-fs this is what appairs:
root#3be6ee5c1ab6:/fxa-webrtc-idp# npm ls graceful-fs
npm info it worked if it ends with ok
npm info using npm#3.10.10
npm info using node#v6.9.5
fxa-webrtc-idp#0.64.0 /fxa-webrtc-idp
+-- grunt#0.4.5
| `-- glob#3.1.21
| `-- graceful-fs#1.2.3
+-- grunt-conventional-changelog#5.0.0
| `-- conventional-changelog#0.5.3
| `-- read-pkg#1.1.0
| +-- load-json-file#1.1.0
| | `-- graceful-fs#4.1.11
| `-- path-type#1.1.0
| `-- graceful-fs#4.1.11
+-- grunt-eslint#17.3.1
| `-- eslint#1.10.3
| `-- file-entry-cache#1.3.1
| `-- flat-cache#1.2.2
| `-- graceful-fs#4.1.11
+-- grunt-jscs#2.7.0
| `-- jscs#2.9.0
| `-- babel-jscs#2.0.5
| `-- babel-core#5.8.38
| +-- output-file-sync#1.1.2
| | `-- graceful-fs#4.1.11
| `-- regenerator#0.8.40
| `-- commoner#0.10.8
| `-- graceful-fs#4.1.11
+-- grunt-nodemon#0.4.1
| `-- nodemon#1.11.0
| +-- chokidar#1.6.1
| | `-- readdirp#2.1.0
| | `-- graceful-fs#4.1.11
| `-- update-notifier#0.5.0
| `-- configstore#1.4.0
| +-- graceful-fs#4.1.11
| `-- write-file-atomic#1.3.1
| `-- graceful-fs#4.1.11
`-- grunt-nsp#2.1.2
`-- nsp#2.0.1
`-- nodesecurity-npm-utils#3.0.0
`-- silent-npm-registry-client#1.0.0
`-- npm-registry-client#6.3.3
`-- graceful-fs#3.0.8
npm info ok
How can i solve my problem? Thanks for the support
Try upgrading your npm. It might help, like it did for me with similar kind of error. Please run below command and
npm install npm#latest -g

Resources