yarn permission problems on OSX high sierra - macos

I'm really scratching my head on this one, and have spent around 1.5 days on trying to resolve the problem
the problem I think has to do with permissions that somehow got reset -
I suspect it happened after I got boot camp assistant to partition for windows dual boot
Environment:
Writing selenium test cases in typescript, using Alsatian and Zalenium frameworks over ts-node - the following command being used to initialise the test runner
yarn run ts-node Tests/runner.ts --tap
yarn environment is running through brew
package.json:
{
"dependencies": {
"#types/dotenv": "^4.0.2",
"#types/selenium-webdriver": "^3.0.8",
"alsatian": "^2.2.1",
"axios": "^0.17.1",
"dotenv": "^5.0.0",
"moment": "^2.20.1",
"selenium-webdriver": "^4.0.0-alpha.1",
"tap-spec": "^4.1.1",
"ts-node": "^4.1.0",
"tslib": "1.8.1",
"typescript": "^2.6.2"
}
}
runner.ts:
import tapSpec = require('tap-spec');
import { TestSet, TestRunner } from "alsatian";
import { config as dotenv } from 'dotenv';
(async () =>
{
// Load up any pseudo environment variables
dotenv({ path: __dirname + '/../.env' });
// Setup the alsatian test runner
let testRunner = new TestRunner();
let tapStream = testRunner.outputStream;
let testSet = TestSet.create();
testSet.addTestsFromFiles('/**/*/*.spec.ts');
// This will output a human readable report to the console.
tapStream.pipe(tapSpec()).pipe(process.stdout);
// Runs the tests
await testRunner.run(testSet);
})()
.catch(e =>
{
console.error(e);
process.exit(1);
});
Problem:
I suspect the problems started after I installed dual boot windows using bootcamp assistant
I worked in windows for 3-4 days on another project and when I came back, started getting permission problems
initially they were along the lines of { Error: EACCES: permission denied, scandir '/Library/Application Support/xxxx'
which I resolved using chmod as stated below - now I'm stuck - read points 7 and 8, I don't know whats causing the problem - but I suspect it's yarn permissions
I had - also updated to typescript 2.7.1 earlier because I'm using the option "strictPropertyInitialization": false, in tsconfig - initially I thought that had cause some problem, but reverting to 2.6.2 hasn't resolved it
removed and rebuilt node_modules
ran first aid from disk utility on partition
reset permissions : https://support.apple.com/en-us/HT203538
re-installed yarn
re-installed brew
granted each complained folder sudo chmod -R 777 '/Library/Application Support', now complaining about no access to '/System/Library/User Template' , cannot use chmod here because I get the error, operation not allowed
yarn run ts-node Tests/runner.ts --tap gives:
warning package.json: No license field
$ /Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/.bin/ts-node Tests/runner.ts --tap
{ Error: EACCES: permission denied, scandir '/System/Library/User Template'
at Object.fs.readdirSync (fs.js:924:18)
at GlobSync._readdir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:288:41)
at GlobSync._readdirInGlobStar (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:267:20)
at GlobSync._readdir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:276:17)
at GlobSync._processReaddir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:137:22)
at GlobSync._process (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:132:10)0
at GlobSync._processReaddir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:207:10)
at GlobSync._process (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:132:10)
at GlobSync._processGlobStar (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:380:10)
at GlobSync._process (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:130:10)
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path: '/System/Library/User Template' }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
sudo yarn run ts-node Tests/runner.ts --tap gives:
{ Error: EBADF: bad file descriptor, scandir '/dev/fd/13'
at Object.fs.readdirSync (fs.js:924:18)
at GlobSync._readdir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:288:41)
at GlobSync._readdirInGlobStar (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:267:20)
at GlobSync._readdir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:276:17)
at GlobSync._processReaddir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:137:22)
at GlobSync._process (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:132:10)
at GlobSync._processReaddir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:207:10)
at GlobSync._process (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:132:10)
at GlobSync._processGlobStar (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:380:10)
at GlobSync._process (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:130:10)
errno: -9,
code: 'EBADF',
syscall: 'scandir',
path: '/dev/fd/13' }
error Command failed with exit code 1.
UPDATE 1 - 19 FEB 2017:
I've placed a test.ts file - which does nothing but print to console , if I call that from yarn ts-node, that works fine
yarn run ts-node Tests/test.ts
output:
yarn run v1.3.2
warning package.json: No license field
$ /Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/.bin/ts-node Tests/test.ts
this is a test
✨ Done in 0.61s.
test.ts:
(async () =>
{
console.log("this is a test");
})()
.catch(e =>
{
console.error(e);
process.exit(1);
});
I have also attempted, what the comment has suggested by #ILI - I fixed the permissions using First Aid in disk utility on the mac partition , since brew no longer supports sudo, I uninstalled yarn from brew, and added it to global packages using
sudo yarn install yarn -g
but still have the same EACCESS error - Error: EACCES: permission denied, scandir '/Library/Application Support/OpenVPN/profile'
Also tried running yarn --verbose, didn't get much detail from there
yarn run --verbose ts-node Tests/runner.ts --tap
yarn run v1.3.2
warning package.json: No license field
verbose 0.331 Checking for configuration file "/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/.npmrc".
verbose 0.331 Checking for configuration file "/Users/dshamim/.npmrc".
verbose 0.331 Checking for configuration file "/usr/local/etc/npmrc".
verbose 0.332 Checking for configuration file "/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/.npmrc".
verbose 0.332 Checking for configuration file "/Users/dshamim/Projects/Acurus/ANEX/anex/.npmrc".
verbose 0.332 Checking for configuration file "/Users/dshamim/Projects/Acurus/ANEX/.npmrc".
verbose 0.332 Checking for configuration file "/Users/dshamim/Projects/Acurus/.npmrc".
verbose 0.332 Checking for configuration file "/Users/dshamim/Projects/.npmrc".
verbose 0.332 Checking for configuration file "/Users/dshamim/.npmrc".
verbose 0.333 Checking for configuration file "/Users/.npmrc".
verbose 0.333 Checking for configuration file "/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/.yarnrc".
verbose 0.333 Checking for configuration file "/Users/dshamim/.yarnrc".
verbose 0.334 Found configuration file "/Users/dshamim/.yarnrc".
verbose 0.334 Checking for configuration file "/usr/local/etc/yarnrc".
verbose 0.334 Checking for configuration file "/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/.yarnrc".
verbose 0.334 Checking for configuration file "/Users/dshamim/Projects/Acurus/ANEX/anex/.yarnrc".
verbose 0.334 Checking for configuration file "/Users/dshamim/Projects/Acurus/ANEX/.yarnrc".
verbose 0.335 Checking for configuration file "/Users/dshamim/Projects/Acurus/.yarnrc".
verbose 0.337 Checking for configuration file "/Users/dshamim/Projects/.yarnrc".
verbose 0.338 Checking for configuration file "/Users/dshamim/.yarnrc".
verbose 0.338 Found configuration file "/Users/dshamim/.yarnrc".
verbose 0.338 Checking for configuration file "/Users/.yarnrc".
verbose 0.34 current time: 2018-02-19T00:39:49.960Z
$ /Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/.bin/ts-node Tests/runner.ts --tap
{ Error: EACCES: permission denied, scandir '/Library/Application Support/OpenVPN/profile'
at Object.fs.readdirSync (fs.js:924:18)
at GlobSync._readdir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:288:41)
at GlobSync._readdirInGlobStar (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:267:20)
at GlobSync._readdir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:276:17)
at GlobSync._processReaddir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:137:22)
at GlobSync._process (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:132:10)
at GlobSync._processReaddir (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:207:10)
at GlobSync._process (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:132:10)
at GlobSync._processGlobStar (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:380:10)
at GlobSync._process (/Users/dshamim/Projects/Acurus/ANEX/anex/ANEX.Website.ManagementPortal.Tests/node_modules/glob/sync.js:130:10)
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path: '/Library/Application Support/OpenVPN/profile' }
verbose 51.049 Error: Command failed with exit code 1.
at /usr/local/Cellar/yarn/1.3.2/libexec/lib/cli.js:35620:15
at Generator.throw (<anonymous>)
at step (/usr/local/Cellar/yarn/1.3.2/libexec/lib/cli.js:92:30)
at /usr/local/Cellar/yarn/1.3.2/libexec/lib/cli.js:105:13
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Some times it's the simple things that we miss, don't worry we have all been here.
This is a case of over thinking the issue, to steal a line from an Aussie beer commercial, you need to "UNDERTHINK IT". https://youtu.be/1MdAhVetBq8
The fact that your simple test script worked but the main test runner didn't, would have pointed me in the direction of stepping through the test runner script, rather than looking at yarn or any other culprit.
Turns out you were telling alsatian to search your entire hard drive for test cases, in which some folders it did not have permissions to access.
Change:
testSet.addTestsFromFiles('/**/*/*.spec.ts');
To:
testSet.addTestsFromFiles('**/*/*.spec.ts');
Or:
testSet.addTestsFromFiles('./**/*/*.spec.ts');
And all should work as you expect.

Related

sass with auto-refresh using parcel , getting errno: -4058, code: 'ENOENT' when running start script

I'm trying to setup Sass with auto-refresh using parcel,
and when I'm using script "start": "parcel src/index.html", I'm constantly getting the following error:
Error: ENOENT: no such file or directory, open 'D:\vscodeprojects\RSSchool\dict\dict.txt'
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at makeCompression (D:\vscodeprojects\RSSchool\Stage#1\imdenver-JSFELT\english_for_kids\node_modules\lmdb\dist\index.cjs:2047:19)
at Object.open (D:\vscodeprojects\RSSchool\Stage#1\imdenver-JSFELT\english_for_kids\node_modules\lmdb\dist\index.cjs:2057:25)
at new LMDBCache (D:\vscodeprojects\RSSchool\Stage#1\imdenver-JSFELT\english_for_kids\node_modules#parcel\cache\lib\LMDBCache.js:81:34)
at resolveOptions (D:\vscodeprojects\RSSchool\Stage#1\imdenver-JSFELT\english_for_kids\node_modules#parcel\core\lib\resolveOptions.js:125:168)
at async Parcel._init (D:\vscodeprojects\RSSchool\Stage#1\imdenver-JSFELT\english_for_kids\node_modules#parcel\core\lib\Parcel.js:218:27)
at async Parcel.watch (D:\vscodeprojects\RSSchool\Stage#1\imdenver-JSFELT\english_for_kids\node_modules#parcel\core\lib\Parcel.js:315:7)
at async run (D:\vscodeprojects\RSSchool\Stage#1\imdenver-JSFELT\english_for_kids\node_modules\parcel\lib\cli.js:351:9) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: 'D:\vscodeprojects\RSSchool\dict\dict.txt'
}
This dict file outside of the project folder doesn't make sense.
Please advise.
I cloned into your repo and run with below package.json config
Replaced "start":"parcel src/index.html" with "start":"parcel"
App runs

Getting error while bootstrapping opensearch dashboard

I am setting up opensearch dashboard in my windows PC and following below guide -
https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md
While bootstrapping, I am getting below error -
PS D:\opensearch\OpenSearch-Dashboards> yarn osd bootstrap
yarn run v1.22.18
$ node scripts/osd bootstrap
info [opensearch-dashboards] running yarn
$ node ./preinstall_check
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "typescript#4.0.2" is incompatible with requested version "typescript#~4.5.2"
success Already up-to-date.
succ yarn.lock analysis completed without any issues
succ 10 bootstrap builds are cached
info [#osd/i18n] running [osd:bootstrap] script
info [#osd/monaco] running [osd:bootstrap] script
info [#osd/opensearch-archiver] running [osd:bootstrap] script
info [#osd/opensearch] running [osd:bootstrap] script
ERROR [bootstrap] failed:
ERROR Error: Command failed with exit code 1: C:\Users\st\AppData\Roaming\nvm\v14.18.2\node_modules\yarn\bin\yarn.js run osd:bootstrap
'rm' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
$ rm -rf target && tsc
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
at makeError (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:25150:11)
at handlePromise (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:24085:26)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:9051:9
at async scheduleItem (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:10938:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
what I see here is, rm command is not recognized in windows and which is correct.
So how to fix this ?

yarn deploy give error with Command failed with exit code 1 when running collection-examples-as

I am trying to run the collection-examples-as near example but when I run yarn deploy it gives me the following error
$ near dev-deploy --wasmFile="./contract.wasm"
Starting deployment. Account id: dev-1637744501224-6323200, node:
https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file:
./contract.wasm
An error occurred
Error: ENOENT: no such file or directory, open './contract.wasm'
[Error: ENOENT: no such file or directory, open './contract.wasm'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './contract.wasm'
}
error Command failed with exit code 1.
I think the error is it can't find the path to ./contract.wasm so I run yarn build the I tried to deploy it again using yarn deploy but I got another error which is:
$ near dev-deploy --wasmFile="./contract.wasm"
Starting deployment. Account id: dev-1637744501224-6323200, node:
https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file:
./contract.wasm
An error occurred
Error: Can not sign transactions for account dev-1637744501224-6323200 on network
default, no matching key pair found in
InMemorySigner(MergeKeyStore(UnencryptedFileSystemKeyStore(/home/rasha/.near-
credentials), UnencryptedFileSystemKeyStore(/home/rasha/collection-examples-
as/neardev))).
{
type: 'KeyNotFound',
context: undefined
}
any help or suggestions?
There's an issue with old versions of near-cli and dev-deploy.
As a workaround, you can try running the latest cli directly from your terminal:
near dev-deploy --wasmFile="./contract.wasm" -f
Just check that you installed the latest version of near-cli, currently 2.2.0. You can check your version with near --version.
Be sure to run yarn build first, so you'll have the compiled contract.wasm file.
Note: When you run yarn deploy, it uses the old near-cli version defined in package.json. (probably some old version like 1.6.0)
You might also want to check this GitHub issue (dev-deploy error): https://github.com/near/create-near-app/issues/1408

Github Copilot : Extension host terminated unexpectedly VS Code

Github Copilot v1.5.3295
VSCode Version : 1.61.2 Arm64
Apple M1 Chip
ERR Extension host (LocalProcess) terminated unexpectedly. The following extensions were running: vscode.microsoft-authentication, mechatroner.rainbow-csv, Dart-Code.dart-code, vscode.debug-auto-launch, vscode.git, GitHub.copilot, jeroen-meijer.pubspec-assist, ms-python.python, ms-vscode.cpptools, Shan.code-settings-sync, vscode.github-authentication, Dart-Code.flutter, ms-vscode.js-debug, vscode.github, ms-iot.vscode-ros, ms-python.vscode-pylance, vscode.emmet, vscode.merge-conflict, eamodio.gitlens, softwaredotcom.swdc-vscode, usernamehw.errorlens, softwaredotcom.swdc-100-days-of-code, vscode.configuration-editing, vscode.json-language-features, vscode.typescript-language-features
internal/fs/watchers.js:226 throw error; ^Error: ENOENT: no such file or directory, watch '/Users/incals/.software/flowChange.json' at FSWatcher.<computed> (internal/fs/watchers.js:218:26) at Object.watch (fs.js:1525:34) at new u (/Users/incals/.vscode/extensions/softwaredotcom.swdc-vscode-2.6.1/dist/extension.js:2:1279288) at Function.getInstance (/Users/incals/.vscode/extensions/softwaredotcom.swdc-vscode-2.6.1/dist/extension.js:2:1279505) at Timeout._onTimeout (/Users/incals/.vscode/extensions/softwaredotcom.swdc-vscode-2.6.1/dist/extension.js:2:1246531) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) { errno: -2, syscall: 'watch', code: 'ENOENT', path: '/Users/incals/.software/flowChange.json', filename: '/Users/incals/.software/flowChange.json'}
This issue caused by this plugin, disabled this plugin and now working fine.
100-days-of-code
https://marketplace.visualstudio.com/items?itemName=softwaredotcom.swdc-100-days-of-code
and Code Time v2.6.1
https://marketplace.visualstudio.com/items?itemName=softwaredotcom.swdc-vscode

push jar file to my java heroku app using CLI

I am running a javascript app in heroku (scoold) and have been told by the developer that there is a new jar file to upload. I Downloaded the heroku cli and jar file and ran the following commands as instructed:
heroku plugins:install java
heroku deploy:jar scoold-x.y.z.jar --app myscooldapp
However, I am getting the following error:
C:\Sites>heroku deploy:jar scoold-pro-1.37.1.jar --app nocodeflow
Uploading scoold-pro-1.37.1.jar
events.js:187
throw er; // Unhandled 'error' event
^
Error: spawn java ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn java',
path: 'java',
spawnargs: [
'-Dheroku.appName=nocodeflow',
'-Xmx1g',
'-Dheroku.jarFile=scoold-pro-1.37.1.jar',
'-Dheroku.jarOpts=',
'-cp',
'C:\\Users\\Artwe\\AppData\\Local\\heroku\\node_modules\\#heroku-cli\\plugin-java\\lib\\heroku-deploy-complete.jar',
'com.heroku.sdk.deploy.DeployJar'
]
}
I create a ticket on the Heroku support center, because I had the same problem.
I want to deploy a simple war and normally I don't need any Node.js ...

Resources