2

I'm wanting to create a symlink in my package.json:

"postinstall":"ln -s ../../dist foo/dist"

however nothing appears.

Command works fine in terminal.

Maybe I should use a terminal emulator to cater for windows?

SuperUberDuper
  • 9,242
  • 9
  • 39
  • 72

1 Answers1

0

System: Ubuntu 16 Npm: 3.5.2

In file package.json I have

{
  "scripts": {
    "postinstall": "ln -fs a b"
  }
}

In catalog I have the following files

ls -la
drwxrwxr-x   6 daniel daniel 4096 maj 15 09:51 .
drwxrwxr-x   4 daniel daniel 4096 maj 14 21:26 ..
-rw-rw-r--   1 daniel daniel    0 maj 15 09:50 a
-rw-rw-r--   1 daniel daniel   55 maj 15 09:50 package.json

I use command

npm install

That prints

 undefined postinstall /home/daniel
 ln -fs a b

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.1.1
npm WARN frontend No repository field.
npm WARN frontend No license

Then I list files again:

ls -la
drwxrwxr-x   6 daniel daniel 4096 maj 15 09:51 .
drwxrwxr-x   4 daniel daniel 4096 maj 14 21:26 ..
-rw-rw-r--   1 daniel daniel    0 maj 15 09:50 a
lrwxrwxrwx   1 daniel daniel    1 maj 15 09:51 b -> a
-rw-rw-r--   1 daniel daniel   55 maj 15 09:50 package.json

Try reproduce these commands and let me know if it helps.

Daniel
  • 7,684
  • 7
  • 52
  • 76